You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/02/16 05:19:03 UTC

[GitHub] [parquet-mr] wgtmac commented on pull request #1028: PARQUET-2244: Fix notIn for columns with null values

wgtmac commented on PR #1028:
URL: https://github.com/apache/parquet-mr/pull/1028#issuecomment-1432527608

   > I did a quick test using Spark
   > 
   > ```
   >           Seq("A", "A", null).toDF("column").repartition(1).write.mode("overwrite").parquet("t")
   >           spark.read.parquet("t").where("NOT (column <=> 'A')").show    // this returns null
   >           spark.read.parquet("t").where("NOT (column = 'A')").show    // this returns empty
   >           spark.read.parquet("t").where("column IN ('A')").show    // this returns A A
   >           spark.read.parquet("t").where("column NOT IN ('A')").show    // this returns empty
   > ```
   > 
   > If we only has `A` and `null` for `column` and we have predicate `column not in ('A')`, should we return empty instead of null?
   
   IIUC, 
   - `col IN (A, B)` is equal to `col = A OR col = B`
   - `col NOT IN (A, B)` is equal to `col <> A AND col <> B`. where `col <> A` means `col IS NOT NULL and col != A`
   
   So my answer to your question above is empty. @huaxingao 
   
   It seems that we lose the chance to skip the row group with this fix. @gszadovszky 


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org