Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature][Connector-V2][SelectDB Cloud] Support SelectDB Cloud Sink Connector #3958

Merged
merged 12 commits into from Jan 31, 2023

Conversation

zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Jan 16, 2023

Purpose of this pull request

Check list

  • Code changed are covered with tests, or it does not need tests for reason:
    SelectDB Cloud is a cloud native database, and docker cannot be used to start test cases.
  • If any new Jar binary package adding in your PR, please add License Notice according
    New License Guide
  • If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
  • 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
  • Update the release-note.

Test procedure

SelectDB Table Schema

CREATE  TABLE `TypeTest` (
    c_map varchar(1000),
    c_array array<int>,
    c_string String,
    c_boolean boolean,
    c_tinyint tinyint,
    c_smallint smallint,
    c_int int,
    c_bigint bigint,
    c_float float,
    c_double double,
    c_decimal  decimal(27, 9),
    c_null String,
    c_bytes String,
    c_date date,
    c_timestamp datetime
) ENGINE=OLAP
DUPLICATE KEY(`c_map`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`c_map`) BUCKETS 4
  1. ST Engine
    • config
   env {
      execution.parallelism = 1
      job.mode = "BATCH"
      checkpoint.interval = 10
    }

      source {
        FakeSource {
          row.num = 10
          parallelism = 1
          schema = {
            fields {
              c_map = "map<string, string>"
              c_array = "array<int>"
              c_string = string
              c_boolean = boolean
              c_tinyint = tinyint
              c_smallint = smallint
              c_int = int
              c_bigint = bigint
              c_float = float
              c_double = double
              c_decimal = "decimal(27, 9)"
              c_null = "null"
              c_bytes = bytes
              c_date = date
              c_timestamp = timestamp
            }
          }
          result_table_name = "fake"
        }
      }
      
      transform {
      }
      
      sink {
        SelectDBCloud {
          load-url="ip:port"
          jdbc-url="ip:port"
          cluster-name="SeaTunnel"
          table.identifier="test.TypeTest"
          username="admin"
          password="******"
          selectdb.config {
              file.type="json"
              file.strip_outer_array="false"
          }
        }
      }
  • result
    image
    image
  1. Flink
    • config
   env {
        execution.parallelism = 1
        job.mode = "BATCH"
    }

      source {
        FakeSource {
          row.num = 10
          parallelism = 1
          schema = {
            fields {
              c_map = "map<string, string>"
              c_array = "array<int>"
              c_string = string
              c_boolean = boolean
              c_tinyint = tinyint
              c_smallint = smallint
              c_int = int
              c_bigint = bigint
              c_float = float
              c_double = double
              c_decimal = "decimal(27, 9)"
              c_null = "null"
              c_bytes = bytes
              c_date = date
              c_timestamp = timestamp
            }
          }
          result_table_name = "fake"
        }
      }
      
      transform {
      }
      
      sink {
        SelectDBCloud {
          load-url="ip:port"
          jdbc-url="ip:port"
          cluster-name="SeaTunnel"
          table.identifier="test.TypeTest"
          username="admin"
          password="******"
          selectdb.config {
              file.type="json"
              file.strip_outer_array="false"
          }
        }
      }
  • result
    image
    image
  1. Spark
    • Config
  env {
        job.name = "SeaTunnel"
        spark.executor.instances = 1
        spark.executor.cores = 1
        spark.executor.memory = "1g"
        spark.master = local
      }
      
      source {
        FakeSource {
          row.num = 10
          parallelism = 1
          schema = {
            fields {
              c_map = "map<string, string>"
              c_array = "array<int>"
              c_string = string
              c_boolean = boolean
              c_tinyint = tinyint
              c_smallint = smallint
              c_int = int
              c_bigint = bigint
              c_float = float
              c_double = double
              c_decimal = "decimal(27, 9)"
              c_null = "null"
              c_bytes = bytes
              c_date = date
              c_timestamp = timestamp
            }
          }
          result_table_name = "fake"
        }
      }
      
      transform {
      }
      
      sink {
        SelectDBCloud {
          load-url="ip:port"
          jdbc-url="ip:port"
          cluster-name="SeaTunnel"
          table.identifier="test.TypeTest"
          username="admin"
          password="******"
          selectdb.config {
              file.type="json"
              file.strip_outer_array="false"
          }
        }
      }
  • result

image
image

@TaoZex
Copy link
Contributor

TaoZex commented Jan 16, 2023

Please fix code style.
image

You can refer this doc : https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/setup.md

Copy link
Contributor

@TaoZex TaoZex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not have a docker environment for e2e testing, add screenshots to prove that the connector is available.

@zy-kkk
Copy link
Member Author

zy-kkk commented Jan 17, 2023

Please add e2e testcase module

references https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e

SelectDB Cloud is a cloud native database, and docker cannot be used to start test cases. I will fill in the screenshot of my test results in the description of pull request later

@hailin0
Copy link
Contributor

hailin0 commented Jan 17, 2023

Please add e2e testcase module
references https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e

SelectDB Cloud is a cloud native database, and docker cannot be used to start test cases. I will fill in the screenshot of my test results in the description of pull request later

Still need to add e2e moduel, but can add annotation @org.junit.jupiter.api.Disabled

@zy-kkk

@zy-kkk
Copy link
Member Author

zy-kkk commented Jan 18, 2023

Please add e2e testcase module
references https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e

SelectDB Cloud is a cloud native database, and docker cannot be used to start test cases. I will fill in the screenshot of my test results in the description of pull request later

Still need to add e2e moduel, but can add annotation @org.junit.jupiter.api.Disabled

@zy-kkk

done

TaoZex
TaoZex previously approved these changes Jan 20, 2023
Copy link
Contributor

@TaoZex TaoZex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@TyrantLucifer TyrantLucifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hailin0 hailin0 merged commit 79a134a into apache:dev Jan 31, 2023
harveyyue pushed a commit to harveyyue/seatunnel that referenced this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants