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] Support Druid Source & Sink #2937

Closed
wants to merge 1 commit into from

Conversation

guanboo
Copy link

@guanboo guanboo commented Sep 28, 2022

fix [Feature][Connector] New SeaTunnel API Connectors #1946 Add Druid Source & Sink


> Druid sink connector

## Description
Copy link
Member

Choose a reason for hiding this comment

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

| timestamp_format | `String` | no | auto |
| timestamp_missing_value | `String` | no | - |

### coordinator_url [`String`]
Copy link
Member

Choose a reason for hiding this comment

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


> Druid source connector

## Description
Copy link
Member

Choose a reason for hiding this comment

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

Same as the Sink document.

Copy link
Member

@ashulin ashulin left a comment

Choose a reason for hiding this comment

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

Expect the connector to complete.

And can you add e2e to seatunnel-connector-v2-e2e module? you can see #2924.

@@ -198,6 +198,12 @@
<snappy-java.version>1.1.8.3</snappy-java.version>
<checker.qual.version>3.10.0</checker.qual.version>
<awaitility.version>4.2.0</awaitility.version>
<httpclient.version>4.5.13</httpclient.version>
<fastjson.version>1.2.83</fastjson.version>
Copy link
Member

Choose a reason for hiding this comment

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

Please manager the jars which used by connector in connector pom.xml like other connector.


<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

Suggest use jackson replace fastjson.

</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

same as above.

statement = connection.prepareStatement(quarySQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
return statement.getMetaData();
} catch (SQLException se) {
throw new SQLException("ResultSetMetaData() failed." + se.getMessage(), se);
Copy link
Member

Choose a reason for hiding this comment

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

Please use ExceptionUtils.getMessage() replace se.getMessage()

resultSet = statement.executeQuery();
hasNext = resultSet.next();
} catch (SQLException se) {
throw new IllegalArgumentException("openInputFormat() failed." + se.getMessage(), se);
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.


private SeaTunnelRowType initTableField() {
ArrayList<SeaTunnelDataType<?>> seaTunnelDataTypes = new ArrayList<>();
ArrayList<String> fieldNames = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

LOGGER.info("Druid write task has been sent, and the response is {}", response.toString());
}
} catch (IOException e) {
e.printStackTrace();
Copy link
Member

Choose a reason for hiding this comment

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

Please don't use e.printStackTrace() and use logger to output exception messages.

private Integer parallelism;

public DruidSourceOptions(Config pluginConfig) {
this.url = pluginConfig.getString(DruidSourceConfig.URL);
Copy link
Member

Choose a reason for hiding this comment

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

Please check whether params exists before get it.

private int parallelism;

public DruidSinkOptions(Config pluginConfig) {
this.coordinatorURL = pluginConfig.getString(DruidSinkConfig.COORDINATOR_URL);
Copy link
Member

Choose a reason for hiding this comment

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

Please check whether params exists before get it.

druidInputFormat = new DruidInputFormat(druidSourceOptions);
this.rowTypeInfo = druidInputFormat.getRowTypeInfo();
} catch (Exception e) {
throw new PrepareFailException("Druid", PluginType.SOURCE, e.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Replace e.toString() with ExceptionUtils.getMessage(e)

@ashulin ashulin changed the title fix [Feature][Connector] New SeaTunnel API Connectors #1946 Add Druid… [Feature][Connector-V2] Support Druid Source & Sink Sep 28, 2022
guanboo pushed a commit to guanboo/incubator-seatunnel that referenced this pull request Sep 30, 2022
@guanboo
Copy link
Author

guanboo commented Sep 30, 2022

Expect the connector to complete.

And can you add e2e to seatunnel-connector-v2-e2e module? you can see #2924.

hi bro,development e2e testcase,There are some problems with my environment. this is message:
#2876 (comment)

guanboo pushed a commit to guanboo/incubator-seatunnel that referenced this pull request Oct 21, 2022
guanboo pushed a commit to guanboo/incubator-seatunnel that referenced this pull request Oct 21, 2022
guanboo pushed a commit to guanboo/incubator-seatunnel that referenced this pull request Oct 21, 2022
@EricJoy2048
Copy link
Member

Hi, @guanboo Did you fix the problems?

@guanboo
Copy link
Author

guanboo commented Nov 8, 2022

Hi, @guanboo Did you fix the problems?

Yes,done

@ic4y
Copy link
Contributor

ic4y commented Nov 21, 2022

@guanboo please fix CI error and resolve conflicts

@laglangyue
Copy link
Contributor

hi brother,did you continue this PR?
I am studying the reader connector of druid. The implementation method is somewhat different from yours. Through the raw json protocol. I think we can communicate

@MonsterChenzhuo
Copy link
Contributor

@guanboo Will this pr go ahead? If not, I would like to take over and finish it

@laglangyue
Copy link
Contributor

@guanboo Will this pr go ahead? If not, I would like to take over and finish it

yes,brother. the pr is going,the connector is complete,but e2e is not completely, I has finished the reader of e2e,and guanboo try to finished the writer of e2e, but he is so busy to do it.I not similar with the writer for druid.

@laglangyue
Copy link
Contributor

@guanboo Will this pr go ahead? If not, I would like to take over and finish it

if you so similar with druid you can continue it or another pr,guanboo and I are so busy for our work.

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.

7 participants