You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/01/30 00:23:03 UTC

[doris] branch master updated: [typo](doc)Add an example of how to assign a value to a field of Date type (#16199)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 9894d239b7 [typo](doc)Add an example of how to assign a value to a field of Date type (#16199)
9894d239b7 is described below

commit 9894d239b748a46bd97040bb8a0f4dd9688ed109
Author: fracly <13...@users.noreply.github.com>
AuthorDate: Mon Jan 30 08:22:52 2023 +0800

    [typo](doc)Add an example of how to assign a value to a field of Date type (#16199)
    
    * 添加Date类型字段赋值示例,Date类型字段需要使用Epoch Day
    
    * Update flink-doris-connector.md
---
 docs/en/docs/ecosystem/flink-doris-connector.md    | 9 +++++----
 docs/zh-CN/docs/ecosystem/flink-doris-connector.md | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/docs/en/docs/ecosystem/flink-doris-connector.md b/docs/en/docs/ecosystem/flink-doris-connector.md
index 15a2caf2f2..65a406e50d 100644
--- a/docs/en/docs/ecosystem/flink-doris-connector.md
+++ b/docs/en/docs/ecosystem/flink-doris-connector.md
@@ -291,8 +291,8 @@ executionBuilder.setLabelPrefix("label-doris") //streamload label prefix
                 .setStreamLoadProp(properties); //streamload params
 
 //flink rowdata‘s schema
-String[] fields = {"city", "longitude", "latitude"};
-DataType[] types = {DataTypes.VARCHAR(256), DataTypes.DOUBLE(), DataTypes.DOUBLE()};
+String[] fields = {"city", "longitude", "latitude", "destroy_date"};
+DataType[] types = {DataTypes.VARCHAR(256), DataTypes.DOUBLE(), DataTypes.DOUBLE(), DataTypes.DATE()};
 
 builder.setDorisReadOptions(DorisReadOptions.builder().build())
         .setDorisExecutionOptions(executionBuilder.build())
@@ -307,10 +307,11 @@ DataStream<RowData> source = env.fromElements("")
     .map(new MapFunction<String, RowData>() {
         @Override
         public RowData map(String value) throws Exception {
-            GenericRowData genericRowData = new GenericRowData(3);
+            GenericRowData genericRowData = new GenericRowData(4);
             genericRowData.setField(0, StringData.fromString("beijing"));
             genericRowData.setField(1, 116.405419);
             genericRowData.setField(2, 39.916927);
+            genericRowData.setField(3, LocalDate.now().toEpochDay());
             return genericRowData;
         }
     });
@@ -473,4 +474,4 @@ Before Connector1.1.0, it was written in batches, and the writing was driven by
 
 9. **tablet writer write failed, tablet_id=190958, txn_id=3505530, err=-235**
 
-It usually occurs before Connector1.1.0, because the writing frequency is too fast, resulting in too many versions. The frequency of Streamload can be reduced by setting the sink.batch.size and sink.batch.interval parameters.
\ No newline at end of file
+It usually occurs before Connector1.1.0, because the writing frequency is too fast, resulting in too many versions. The frequency of Streamload can be reduced by setting the sink.batch.size and sink.batch.interval parameters.
diff --git a/docs/zh-CN/docs/ecosystem/flink-doris-connector.md b/docs/zh-CN/docs/ecosystem/flink-doris-connector.md
index 90438ed2ea..d0148561c7 100644
--- a/docs/zh-CN/docs/ecosystem/flink-doris-connector.md
+++ b/docs/zh-CN/docs/ecosystem/flink-doris-connector.md
@@ -288,8 +288,8 @@ executionBuilder.setLabelPrefix("label-doris") //streamload label prefix
                 .setStreamLoadProp(properties); //streamload params
 
 //flink rowdata‘s schema
-String[] fields = {"city", "longitude", "latitude"};
-DataType[] types = {DataTypes.VARCHAR(256), DataTypes.DOUBLE(), DataTypes.DOUBLE()};
+String[] fields = {"city", "longitude", "latitude", "destroy_date"};
+DataType[] types = {DataTypes.VARCHAR(256), DataTypes.DOUBLE(), DataTypes.DOUBLE(), DataTypes.DATE()};
 
 builder.setDorisReadOptions(DorisReadOptions.builder().build())
         .setDorisExecutionOptions(executionBuilder.build())
@@ -304,10 +304,11 @@ DataStream<RowData> source = env.fromElements("")
     .map(new MapFunction<String, RowData>() {
         @Override
         public RowData map(String value) throws Exception {
-            GenericRowData genericRowData = new GenericRowData(3);
+            GenericRowData genericRowData = new GenericRowData(4);
             genericRowData.setField(0, StringData.fromString("beijing"));
             genericRowData.setField(1, 116.405419);
             genericRowData.setField(2, 39.916927);
+            genericRowData.setField(3, LocalDate.now().toEpochDay());
             return genericRowData;
         }
     });
@@ -470,4 +471,4 @@ Connector1.1.0版本以前,是攒批写入的,写入均是由数据驱动,
 
 9. **tablet writer write failed, tablet_id=190958, txn_id=3505530, err=-235**
 
-通常发生在Connector1.1.0之前,是由于写入频率过快,导致版本过多。可以通过设置sink.batch.size 和 sink.batch.interval参数来降低Streamload的频率。
\ No newline at end of file
+通常发生在Connector1.1.0之前,是由于写入频率过快,导致版本过多。可以通过设置sink.batch.size 和 sink.batch.interval参数来降低Streamload的频率。


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org