teeyog commented on a change in pull request #2475:
URL: https://github.com/apache/hudi/pull/2475#discussion_r579907953
##########
File path:
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/DefaultSource.scala
##########
@@ -74,6 +78,19 @@ class DefaultSource extends RelationProvider
val tablePath = DataSourceUtils.getTablePath(fs, globPaths.toArray)
log.info("Obtained hudi table path: " + tablePath)
+ val sparkEngineContext = new
HoodieSparkEngineContext(sqlContext.sparkContext)
+ val fsBackedTableMetadata =
+ new FileSystemBackedTableMetadata(sparkEngineContext, new
SerializableConfiguration(fs.getConf), tablePath, false)
+ val partitionPaths = fsBackedTableMetadata.getAllPartitionPaths
+ val onePartitionPath = if(!partitionPaths.isEmpty &&
!StringUtils.isEmpty(partitionPaths.get(0))) {
+ tablePath + "/" + partitionPaths.get(0)
+ } else {
+ tablePath
+ }
+ val dataPath = DataSourceUtils.getDataPath(tablePath, onePartitionPath)
+ log.info("Obtained hudi data path: " + dataPath)
+ parameters += "path" -> dataPath
Review comment:
The path specified by the user will be overwritten by the automatically
inferred data directory, and your needs cannot be met
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]