Github user yin commented on a diff in the pull request:
https://github.com/apache/spark/pull/13022#discussion_r67873879
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala ---
@@ -531,18 +531,29 @@ private[hive] class
HiveMetastoreCatalog(sparkSession: SparkSession) extends Log
/**
* An override of the standard HDFS listing based catalog, that overrides
the partition spec with
* the information from the metastore.
+ * @param tableBasePath The default base path of the Hive metastore table
+ * @param partitionSpec The partition specifications from Hive metastore
*/
private[hive] class MetaStoreFileCatalog(
sparkSession: SparkSession,
- paths: Seq[Path],
- partitionSpecFromHive: PartitionSpec)
+ tableBasePath: Path,
+ override val partitionSpec: PartitionSpec)
extends ListingFileCatalog(
sparkSession,
- paths,
+ MetaStoreFileCatalog.getPaths(tableBasePath, partitionSpec),
Map.empty,
- Some(partitionSpecFromHive.partitionColumns)) {
+ Some(partitionSpec.partitionColumns)) {
+}
- override def partitionSpec(): PartitionSpec = partitionSpecFromHive
+private[hive] object MetaStoreFileCatalog {
+ /** Get the list of non-overalapping paths to list files in the for a
metastore table */
+ def getPaths(tableBasePath: Path, partitionSpec: PartitionSpec):
Seq[Path] = {
+ val basePathStr = tableBasePath.toUri.toString
+ val partitionsOutsideBasePath = partitionSpec
--- End diff --
I spent some time analyzing your problem and I agree with your second
option. Why am I included in this discussion anyways? I never contributed to
Spark.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]