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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]