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/09/27 02:45:25 UTC

[GitHub] [incubator-seatunnel] enterwhat opened a new pull request, #2906: https://github.com/apache/incubator-seatunnel/issues/2893

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

   https://github.com/apache/incubator-seatunnel/issues/2893
   
   feat #2893 :
   (1),解决-i参数不能传入替换conf的配置文件的source部分占位符的问题,像sql部分一样支持占位符替换。
   
   (2),解决druid的start_date,end_date通过命令行-i传参空格,识别成shell命令行的参数分隔符导致yyyy-MM-dd HH:mm:ss的日期格式参数不能被整体识别,导致运行出错的问题,默认使用特定占位符,可自定义
   
   (3),对druid的输出分隔符进行自定义,以便支持导入到doris
   
   (4),对doris的默认分隔符换成以解决列值里面" "(\t)有影响列识别的问题
   
   (5),druid添加user,password的参数认证支持
   
   (6),对druid connector能够依赖seatunnel的包进行provided标注
   
   # Conflicts:
   #	seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/pom.xml
   
   <!--
   
   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
   
   <!-- 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
   


-- 
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] enterwhat commented on pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1261921402

   > Hi, @enterwhat . Thank's for your contribution. Please change the pr comment to english.
   
   I have commit new commits, should I push a new pr?


-- 
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] hailin0 commented on pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
hailin0 commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1260350730

   <img width="1105" alt="image" src="https://user-images.githubusercontent.com/14371345/192683622-2ecb594b-66c5-480b-ac5c-428bfc067fca.png">
   


-- 
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] enterwhat commented on pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1274428437

   > <img alt="image" width="1105" src="https://user-images.githubusercontent.com/14371345/192683622-2ecb594b-66c5-480b-ac5c-428bfc067fca.png">
   > 
   > https://github.com/apache/incubator-seatunnel/actions/runs/3132748547/jobs/5086755036
   
   I have fixed this


-- 
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 commented on pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1384919360

   hi, thanks for your contribution, dev branch will no longer maintain the V1 version of the connector, so I will close this PR,
   If you are interested in this, you can contribute the corresponding V2Connector
   https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-connectors-v2


-- 
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] enterwhat commented on pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1260330758

   > 
   
   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] enterwhat commented on a diff in pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on code in PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#discussion_r983249207


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -169,6 +179,8 @@ private RowTypeInfo getRowTypeInfo(String jdbcURL, String datasource, Collection
             names[i] = field;
             i++;
         }
+        long count = Arrays.stream(typeInformation).filter(t -> null == t).count();
+        System.out.println("typeInformation null:::" + count);

Review Comment:
   I
   
   > 
   
   I have commit new commits, should I push a new pr?



-- 
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] enterwhat commented on a diff in pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on code in PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#discussion_r982010444


##########
seatunnel-core/seatunnel-core-flink/src/main/java/org/apache/seatunnel/core/flink/command/FlinkApiTaskExecuteCommand.java:
##########
@@ -63,7 +61,10 @@ public FlinkApiTaskExecuteCommand(FlinkCommandArgs flinkCommandArgs) {
     public void execute() throws CommandExecuteException {
         EngineType engine = flinkCommandArgs.getEngineType();
         Path configFile = FileUtils.getConfigPath(flinkCommandArgs);
-
+        this.flinkCommandArgs.getVariables().stream()
+                .map(variable -> variable.split("=", 2))
+                .filter(pair -> pair.length == 2)
+                .forEach(pair -> System.setProperty(pair[0], pair[1]));

Review Comment:
   done



##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -169,6 +179,8 @@ private RowTypeInfo getRowTypeInfo(String jdbcURL, String datasource, Collection
             names[i] = field;
             i++;
         }
+        long count = Arrays.stream(typeInformation).filter(t -> null == t).count();
+        System.out.println("typeInformation null:::" + count);

Review Comment:
   done



##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -117,17 +117,27 @@ public CheckResult checkConfig() {
     @Override
     public void prepare(FlinkEnvironment env) {
         String jdbcURL = config.getString(JDBC_URL);
+        String user = config.getString("user");
+        String password = config.getString("password");
         String datasource = config.getString(DATASOURCE);
-        String startTimestamp = config.hasPath(START_TIMESTAMP) ? config.getString(START_TIMESTAMP) : null;
-        String endTimestamp = config.hasPath(END_TIMESTAMP) ? config.getString(END_TIMESTAMP) : null;
+        String escape_delimiter = config.getString(ESCAPE_DELIMITER_KEY);
+        if (StringUtils.isBlank(escape_delimiter)){
+            escape_delimiter = ESCAPE_DELIMITER_DEFAULT;
+        }
+        String startTimestamp = config.hasPath(START_TIMESTAMP) ? config.getString(START_TIMESTAMP).replaceAll(escape_delimiter, " ") : null;
+        String endTimestamp = config.hasPath(END_TIMESTAMP) ? config.getString(END_TIMESTAMP).replaceAll(escape_delimiter, " ") : null;
         List<String> columns = config.hasPath(COLUMNS) ? config.getStringList(COLUMNS) : null;
-
+        System.out.println(jdbcURL);
+        System.out.println(user);
+        System.out.println(password);

Review Comment:
   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] hailin0 commented on a diff in pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#discussion_r981914999


##########
seatunnel-core/seatunnel-core-flink/src/main/java/org/apache/seatunnel/core/flink/command/FlinkApiTaskExecuteCommand.java:
##########
@@ -63,7 +61,10 @@ public FlinkApiTaskExecuteCommand(FlinkCommandArgs flinkCommandArgs) {
     public void execute() throws CommandExecuteException {
         EngineType engine = flinkCommandArgs.getEngineType();
         Path configFile = FileUtils.getConfigPath(flinkCommandArgs);
-
+        this.flinkCommandArgs.getVariables().stream()
+                .map(variable -> variable.split("=", 2))
+                .filter(pair -> pair.length == 2)
+                .forEach(pair -> System.setProperty(pair[0], pair[1]));

Review Comment:
   @EricJoy2048 
   
   please confirm 



##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -169,6 +179,8 @@ private RowTypeInfo getRowTypeInfo(String jdbcURL, String datasource, Collection
             names[i] = field;
             i++;
         }
+        long count = Arrays.stream(typeInformation).filter(t -> null == t).count();
+        System.out.println("typeInformation null:::" + count);

Review Comment:
   remove?



##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -117,17 +117,27 @@ public CheckResult checkConfig() {
     @Override
     public void prepare(FlinkEnvironment env) {
         String jdbcURL = config.getString(JDBC_URL);
+        String user = config.getString("user");
+        String password = config.getString("password");
         String datasource = config.getString(DATASOURCE);
-        String startTimestamp = config.hasPath(START_TIMESTAMP) ? config.getString(START_TIMESTAMP) : null;
-        String endTimestamp = config.hasPath(END_TIMESTAMP) ? config.getString(END_TIMESTAMP) : null;
+        String escape_delimiter = config.getString(ESCAPE_DELIMITER_KEY);
+        if (StringUtils.isBlank(escape_delimiter)){
+            escape_delimiter = ESCAPE_DELIMITER_DEFAULT;
+        }
+        String startTimestamp = config.hasPath(START_TIMESTAMP) ? config.getString(START_TIMESTAMP).replaceAll(escape_delimiter, " ") : null;
+        String endTimestamp = config.hasPath(END_TIMESTAMP) ? config.getString(END_TIMESTAMP).replaceAll(escape_delimiter, " ") : null;
         List<String> columns = config.hasPath(COLUMNS) ? config.getStringList(COLUMNS) : null;
-
+        System.out.println(jdbcURL);
+        System.out.println(user);
+        System.out.println(password);

Review Comment:
   remove?



-- 
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 closed pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
CalvinKirs closed pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector
URL: https://github.com/apache/incubator-seatunnel/pull/2906


-- 
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] EricJoy2048 commented on a diff in pull request #2906: [Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#discussion_r984306985


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -169,6 +179,8 @@ private RowTypeInfo getRowTypeInfo(String jdbcURL, String datasource, Collection
             names[i] = field;
             i++;
         }
+        long count = Arrays.stream(typeInformation).filter(t -> null == t).count();
+        System.out.println("typeInformation null:::" + count);

Review Comment:
   > 
   
   I suggest you don't push a new pr if the new pr and this pr have many code dependency. Of course, if there is no code dependency between two prs, you can submit.



-- 
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] EricJoy2048 commented on pull request #2906: https://github.com/apache/incubator-seatunnel/issues/2893

Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1258898954

   Hi, @enterwhat . Thank's for your contribution. Please change the pr comment to english.


-- 
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] enterwhat commented on pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#issuecomment-1277160830

   > Hi, @enterwhat . Thank's for your contribution. Please change the pr comment to english.
   
   any problem with this pr? how long will this be reviewed again?


-- 
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] enterwhat commented on a diff in pull request #2906: [Improve][flink][Connector-V1] Improve druid and doris connector

Posted by GitBox <gi...@apache.org>.
enterwhat commented on code in PR #2906:
URL: https://github.com/apache/incubator-seatunnel/pull/2906#discussion_r991065592


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-druid/src/main/java/org/apache/seatunnel/flink/druid/source/DruidSource.java:
##########
@@ -169,6 +179,8 @@ private RowTypeInfo getRowTypeInfo(String jdbcURL, String datasource, Collection
             names[i] = field;
             i++;
         }
+        long count = Arrays.stream(typeInformation).filter(t -> null == t).count();
+        System.out.println("typeInformation null:::" + count);

Review Comment:
   > 
   
   any problem with this pr? how long will this be reviewed again?



-- 
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