LantaoJin commented on a change in pull request #26499: [SPARK-29869][SQL] Fix 
assertion error in HiveMetastoreCatalog#convertToLogicalRelation 
URL: https://github.com/apache/spark/pull/26499#discussion_r346381464
 
 

 ##########
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala
 ##########
 @@ -358,4 +361,23 @@ class DataSourceWithHiveMetastoreCatalogSuite
         Seq(table("src").count().toString))
     }
   }
+
+  test("SPARK-29869: fix HiveMetastoreCatalog#convertToLogicalRelation throws 
AssertionError") {
+    withTempPath(dir => {
+      val baseDir = s"${dir.getCanonicalFile.toURI.toString}/test"
+      val partitionLikeDir = 
s"${dir.getCanonicalFile.toURI.toString}/test/dt=20191113"
+      spark.range(3).selectExpr("id").write.parquet(partitionLikeDir)
+      withTable("non_partition_table") {
+        withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "true") {
+          spark.sql(
+            s"""
+               |CREATE TABLE non_partition_table (id bigint)
 
 Review comment:
   Maybe you are right. Actually the data file path of this table is 
`/path/tablename/dt=yyyymmdd/dt=yyyymmdd/xxx.parquet`. I guess Hive does not 
recursively lookup load the data. So it return empty but not error.
   And I found if when enable recursively lookup by 
`.option("recursiveFileLookup", true)`, the inferPartitioning will be disable. 
So `dt=yyyymmdd` won't be treated as partitionSpec.
   
   So should I revert the code changes and only keep the assert detail 
information? Or auto rollback to do not use built-in Parquet reader to read?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to