lightzhao opened a new pull request, #4494:
URL: https://github.com/apache/incubator-seatunnel/pull/4494

   
   
   <!--
   
   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
   Add customize the row separator, if a message contains multiple row of data, 
you can customize the line separator to split.
   Config:
   ```hocon
   env {
     # You can set flink configuration here
     execution.parallelism = 1
     job.mode = "STREAMING"
     execution.planner = blink
     job.name = "kafka_hive_row_delimiter_test"
     execution.checkpoint.interval = 60000
   }
   
   source {
     Kafka {
       result_table_name = "kafka_table"
       schema = {
         fields {
           c1 = "string"
           c2 = "string"
           c3 = "string"
         }
       }
       format = text
       field_delimiter = ","
       topic = "test_topic_row_delimiter"
       bootstrap.servers = "kafkacluster:9092"
       kafka.max.poll.records = 500
       row_delimiter = "\\n"
    }
   }
   
   transform {
     sql {
       sql = "select c1,c2,c3,CAST(DATE_FORMAT(CAST(NOW() AS 
VARCHAR),'yyyyMMdd') as VARCHAR) as dt from kafka_table"
     }
   }
   
   sink {
     Console{}
     Hive {
       table_name = "db_test1.tmp_test03"
       metastore_uri = "thrift://hive:9083"
       partition_dir_expression = "${v0}"
     }
   }
   ```
   Test screenshot
   <img width="1380" alt="image" 
src="https://user-images.githubusercontent.com/40714172/229677613-b34b2f18-7b75-420e-bad4-6e2d18f4c5e9.png";>
   <img width="893" alt="image" 
src="https://user-images.githubusercontent.com/40714172/229677693-d2dd23b7-6870-4e41-986d-ff217abfd054.png";>
   
   <!-- 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 your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] 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](https://github.com/apache/incubator-seatunnel/tree/dev/docs/en/connector-v2)
     2. Update 
[plugin-mapping.properties](https://github.com/apache/incubator-seatunnel/blob/dev/plugin-mapping.properties)
 and add new connector information in it
     3. Update the pom file of 
[seatunnel-dist](https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the 
[`release-note`](https://github.com/apache/incubator-seatunnel/blob/dev/release-note.md).


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to