You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/03/08 03:52:50 UTC

[GitHub] [incubator-seatunnel] ZhangchengHu0923 opened a new pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

ZhangchengHu0923 opened a new pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433


   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   fix issue #851 
   spark-clickhouse-sink Support /DateTime64/DateTime/Date Column
   
   ## step to test
   
   ```
   -- create source table
   CREATE TABLE pdi.st_source_dates
   (
       `date01` Date,
       `date03` DateTime,
       `date04` DateTime,
       `cust_id` String,
       `cust_name` String,
       `cust_idcard` String,
       `age` Int32,
       `sex` String
   )
   ENGINE = StripeLog
   
   
   --create target table
   CREATE TABLE pdi.st_sink_dates
   (
       `date01` Date,
       `date03` DateTime,
       `date04` DateTime64,
       `cust_id` String,
       `cust_name` String,
       `cust_idcard` String,
       `age` Int32,
       `sex` String
   )
   ENGINE = StripeLog
   ```
   
   
   
   **make Some test data**
   
   ```
   insert into pdi.st_source_dates values
   ('2022-03-05','2019-01-01 12:12:22','2019-01-01 12:22:22','1111111','test_nameaaaa','card11111111',55,'男'),
   ('2022-03-05','2019-01-01 12:12:22','2019-01-01 12:22:22','1111111','test_naaaa','card11111111',90,'男');
   ```
   
   
   **config SeaTunnel**
   vi ./config/jdbc2ck_dates.conf
   
   ```
   env {
     spark.app.name = "SeaTunnel"
     spark.executor.instances = 2
     spark.executor.cores = 1
     spark.executor.memory = "1g"
   }
   
   source {
     jdbc {
       driver = "ru.yandex.clickhouse.ClickHouseDriver"
       url = "jdbc:clickhouse://192.168.1.111:8123/pdi"
       table = "st_source_date"
       result_table_name = "SOURCE_VIEW"
       user = "default"
       password = "jRtXD8F8"
     } 
   }
   
   transform {
   }
   
   sink {
     clickhouse {
       host = "192.168.1.111:8123"
       clickhouse.socket_timeout = 50000
       database = "pdi"
       table = "st_sink_date"
       fields = ["date01","date03","date04","cust_id","cust_name","cust_idcard","age","sex"]
       username = "default"
       password = "jRtXD8F8"
       bulk_size = 20000
    }
   }
   
   
   ```
   
   **start SeaTunnel**
   
   ```
   ./bin/start-seatunnel-spark.sh \
   --master local \
   --deploy-mode client \
   --config ./config/jdbc2ck_dates.conf
   ```
   
   check the data in target table 
   ```
   select * from pdi.st_sink_dates
   ```
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in you PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/developement/NewLicenseGuide.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] ZhangchengHu0923 edited a comment on pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
ZhangchengHu0923 edited a comment on pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433#issuecomment-1061406888


   > @ZhangchengHu0923 Please resolve the conflict, thanks
   
   done @wuchunfu


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] ZhangchengHu0923 commented on pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
ZhangchengHu0923 commented on pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433#issuecomment-1061406888


   > @ZhangchengHu0923 Please resolve the conflict, thanks
   
   done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] wuchunfu commented on pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
wuchunfu commented on pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433#issuecomment-1061398165


   @ZhangchengHu0923 Please resolve the conflict, thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] BenJFan commented on pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
BenJFan commented on pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433#issuecomment-1061536632


   @CalvinKirs LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] ZhangchengHu0923 commented on pull request #1433: fix issue #851 [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
ZhangchengHu0923 commented on pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433#issuecomment-1061378842


   @CalvinKirs Please have a review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] CalvinKirs merged pull request #1433: [Bug#851] [spark-clickhouse-sink] Support /DateTime64/DateTime/Date Column

Posted by GitBox <gi...@apache.org>.
CalvinKirs merged pull request #1433:
URL: https://github.com/apache/incubator-seatunnel/pull/1433


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org