seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

[Feature][Connector-V2] jdbc connector supports Kingbase database

Open NickCodeJourney opened this issue 2 years ago • 14 comments
trafficstars

Purpose of this pull request

Check list

  • [x] Code changed are covered with tests, or it does not need tests for reason:
  • [x] If any new Jar binary package adding in your PR, please add License Notice according New License Guide
  • [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
  • [x] If you are contributing the connector code, please check that the following files are updated:
    1. Update change log that in connector document. For more details you can refer to connector-v2
    2. Update plugin-mapping.properties and add new connector information in it
    3. Update the pom file of seatunnel-dist
  • [x] Update the release-note.

NickCodeJourney avatar May 22 '23 08:05 NickCodeJourney

why close?

hailin0 avatar May 22 '23 09:05 hailin0

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

hailin0 avatar May 23 '23 02:05 hailin0

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

NickCodeJourney avatar Jul 07 '23 02:07 NickCodeJourney

@hailin0 @EricJoy2048 @Hisoka-X please review

NickCodeJourney avatar Jul 07 '23 04:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

NickCodeJourney avatar Jul 07 '23 15:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

NickCodeJourney avatar Jul 08 '23 10:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

This link may help you to fix client encoding error

CheneyYin avatar Jul 11 '23 11:07 CheneyYin

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

This link may help you to fix client encoding error

I tried the method in the link, but I couldn't resolve the issue.It seems unrelated to the Kingbase database container.I used a local Spark for testing, but the Kingbase database was still the one in the container, and it worked successfully.

NickCodeJourney avatar Jul 12 '23 13:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

This link may help you to fix client encoding error

I tried the method in the link, but I couldn't resolve the issue.It seems unrelated to the Kingbase database container.I used a local Spark for testing, but the Kingbase database was still the one in the container, and it worked successfully.

Yes, I have added the spark container, but it can't be solved.

NickCodeJourney avatar Jul 12 '23 15:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

This link may help you to fix client encoding error

I tried the method in the link, but I couldn't resolve the issue.It seems unrelated to the Kingbase database container.I used a local Spark for testing, but the Kingbase database was still the one in the container, and it worked successfully.

Yes, I have added the spark container, but it can't be solved.

image

NickCodeJourney avatar Jul 12 '23 15:07 NickCodeJourney

please add e2e testcase https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e

need all success? Snipaste_2023-07-07_09-57-44

hello @TyrantLucifer ,when i test using spark container Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: ErrorCode:[API-01], ErrorDescription:[Configuration item validate failed] - PluginName: jdbc, PluginType: source, Message: com.kingbase8.util.KSQLException: FATAL: invalid value for parameter "client_encoding": "ANSI_X3.4-1968" at org.apache.seatunnel.core.starter.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:63) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.spark.SeaTunnelSpark.main(SeaTunnelSpark.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958) at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

image in local env is ok,I suspect something is wrong with the container

This link may help you to fix client encoding error

I tried the method in the link, but I couldn't resolve the issue.It seems unrelated to the Kingbase database container.I used a local Spark for testing, but the Kingbase database was still the one in the container, and it worked successfully.

Yes, I have added the spark container, but it can't be solved.

image
 docker run tyrantlucifer/spark:2.4.6 locale -a
 05:17:56.97 
 05:17:56.97 Welcome to the Bitnami spark container
 05:17:56.98 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-spark
 05:17:56.98 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-spark/issues

 05:17:56.98 
C
C.UTF-8
POSIX

This container doesn't support zh_CN.utf-8. And the kingbase container(huzhihui/kingbase:v8r6) locale en_US.UTF-8.

CheneyYin avatar Jul 13 '23 05:07 CheneyYin

image It can fix ansi_x3.4-1968 error.

CheneyYin avatar Jul 13 '23 05:07 CheneyYin

image It can fix ansi_x3.4-1968 error.

thx sir

NickCodeJourney avatar Jul 13 '23 12:07 NickCodeJourney

Snipaste_2023-07-13_22-25-58

NickCodeJourney avatar Jul 13 '23 14:07 NickCodeJourney

@zhilinli123 PTAL

liugddx avatar Aug 09 '23 05:08 liugddx

Are you willing to add connector V2 documentation for this? Refer to code:https://github.com/apache/seatunnel/blob/dev/docs/en/connector-v2/source/Mysql.md Issues:https://github.com/apache/seatunnel/issues/4572 Issues example:https://github.com/apache/seatunnel/issues/4544 @NickYoungPeng

zhilinli123 avatar Aug 09 '23 05:08 zhilinli123

@zhilinli123 TBR

NickCodeJourney avatar Aug 09 '23 10:08 NickCodeJourney

You need to put the screenshot of the e2e test here

liugddx avatar Aug 09 '23 10:08 liugddx

Wait for ci

zhilinli123 avatar Aug 10 '23 02:08 zhilinli123

You need to put the screenshot of the e2e test here

it's above and it's folded

NickCodeJourney avatar Aug 10 '23 06:08 NickCodeJourney

You need to put the screenshot of the e2e test here

https://github.com/apache/seatunnel/pull/4803#issuecomment-1634345386 https://github.com/apache/seatunnel/pull/4803#issuecomment-1632798856

NickCodeJourney avatar Aug 14 '23 15:08 NickCodeJourney

LGTM

Please screenshot the test results. PTAL @ic4y

liugddx avatar Aug 15 '23 01:08 liugddx

LGTM

Please screenshot the test results. PTAL @ic4y

Snipaste_2023-08-15_11-19-09 Snipaste_2023-08-15_11-18-02

NickCodeJourney avatar Aug 15 '23 03:08 NickCodeJourney