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