Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31368

The query with the where condition failed,when the partition field is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.4.4, 2.4.5
    • None
    • SQL

    Description

      The problem recurs as follows:

      1. create table test_1(id int,name string) partitioned by(profile string)
      2. insert into test_1 values(1,null)
      3. select * from test_1 where profile is null

      Go through the above steps,the result is nothing.But if add the condition profile='_HIVE_DEFAULT_PARTITION_',the result is OK.

      The temporary solution:

      select * from test_1 where profile is null or profile='_HIVE_DEFAULT_PARTITION_'

      The result is OK

      Special instructions:

      1、The above phenomenon,Only the partition filed type is string can happen

      2、The above operation in hive is no problem

      Problem orientation:

      As far as I'm consider the problem is in org.apache.spark.sql.catalyst.catalog.ExternalCatalogUtils and org.apache.spark.sql.catalyst.catalog.CatalogTablePartition.Especially the toRow function in CatalogTablePartition.

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            tanwh tanweihua
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: