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/08/18 12:52:54 UTC
[GitHub] [incubator-seatunnel] TyrantLucifer opened a new pull request, #2465: [Feature][Connector-V2] Local file json support
TyrantLucifer opened a new pull request, #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465
<!--
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
#1946 Local file source json support
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
## Check list
* [x] 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)
* [x] 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] ashulin commented on a diff in pull request #2465: [Feature][Connector-V2] Local file json support
Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465#discussion_r949747555
##########
seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/source/LocalFileSource.java:
##########
@@ -56,10 +57,19 @@ public void prepare(Config pluginConfig) throws PrepareFailException {
} catch (IOException e) {
throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Check file path fail.");
}
- try {
- rowType = readStrategy.getSeaTunnelRowTypeInfo(hadoopConf, filePaths.get(0));
- } catch (FilePluginException e) {
- throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Read file schema error.", e);
+ // support user-defined schema
+ if (pluginConfig.hasPath(LocalSourceConfig.SCHEMA)) {
Review Comment:
Can `LocalSourceConfig.SCHEMA` be moved in `SeatunnelSchema`?
--
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] TyrantLucifer commented on pull request #2465: [Feature][Connector-V2] Local file json support
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on PR #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465#issuecomment-1219495854
@CalvinKirs Please 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] EricJoy2048 commented on a diff in pull request #2465: [Feature][Connector-V2] Local file json support
Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465#discussion_r949741662
##########
seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/source/LocalFileSource.java:
##########
@@ -56,10 +57,19 @@ public void prepare(Config pluginConfig) throws PrepareFailException {
} catch (IOException e) {
throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Check file path fail.");
}
- try {
- rowType = readStrategy.getSeaTunnelRowTypeInfo(hadoopConf, filePaths.get(0));
- } catch (FilePluginException e) {
- throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Read file schema error.", e);
+ // support user-defined schema
+ if (pluginConfig.hasPath(LocalSourceConfig.SCHEMA)) {
Review Comment:
I suggest judge the file format and schema together here. Because the user may set a schema to `orc` or `parquet` file, even if we have told them in the document not to do so.
--
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] TyrantLucifer commented on a diff in pull request #2465: [Feature][Connector-V2] Local file json support
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465#discussion_r949819394
##########
seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/source/LocalFileSource.java:
##########
@@ -56,10 +57,19 @@ public void prepare(Config pluginConfig) throws PrepareFailException {
} catch (IOException e) {
throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Check file path fail.");
}
- try {
- rowType = readStrategy.getSeaTunnelRowTypeInfo(hadoopConf, filePaths.get(0));
- } catch (FilePluginException e) {
- throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Read file schema error.", e);
+ // support user-defined schema
+ if (pluginConfig.hasPath(LocalSourceConfig.SCHEMA)) {
Review Comment:
Resolved
##########
seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/source/LocalFileSource.java:
##########
@@ -56,10 +57,19 @@ public void prepare(Config pluginConfig) throws PrepareFailException {
} catch (IOException e) {
throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Check file path fail.");
}
- try {
- rowType = readStrategy.getSeaTunnelRowTypeInfo(hadoopConf, filePaths.get(0));
- } catch (FilePluginException e) {
- throw new PrepareFailException(getPluginName(), PluginType.SOURCE, "Read file schema error.", e);
+ // support user-defined schema
+ if (pluginConfig.hasPath(LocalSourceConfig.SCHEMA)) {
Review Comment:
Resolved
--
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 #2465: [Feature][Connector-V2] Local file json support
Posted by GitBox <gi...@apache.org>.
CalvinKirs merged PR #2465:
URL: https://github.com/apache/incubator-seatunnel/pull/2465
--
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