yuelongsun commented on issue #9382:
URL: https://github.com/apache/seatunnel/issues/9382#issuecomment-2921480194

   通过阅读代码发现, seatunel是通过读取dfs上的文件来生成表的schema的, 若没有数据文件, seatunel会buid一个empty 
scheam返回的。
    HiveSourceConfig中的方法:
       private CatalogTable parseCatalogTableFromRemotePath(
               ReadonlyConfig readonlyConfig,
               HadoopConf hadoopConf,
               List<String> filePaths,
               Table table) {
           **if (CollectionUtils.isEmpty(filePaths)) {
               // When the directory is empty, distribute default behavior 
schema
               return buildEmptyCatalogTable(readonlyConfig, table);**
           }
           CatalogTable catalogTable = buildEmptyCatalogTable(readonlyConfig, 
table);
           try {
               SeaTunnelRowType seaTunnelRowTypeInfo =
                       readStrategy.getSeaTunnelRowTypeInfo(filePaths.get(0));
               return CatalogTableUtil.newCatalogTable(catalogTable, 
seaTunnelRowTypeInfo);
           } catch (FileConnectorException e) {
               String errorMsg =
                       String.format("Get table schema from file [%s] failed", 
filePaths.get(0));
               throw new FileConnectorException(
                       CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED, 
errorMsg, e);
           }
       }


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

Reply via email to