You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Michel Lemay (JIRA)" <ji...@apache.org> on 2019/05/23 13:35:00 UTC
[jira] [Updated] (SPARK-27820) case insensitive resolver should be
used in GetMapValue
[ https://issues.apache.org/jira/browse/SPARK-27820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michel Lemay updated SPARK-27820:
---------------------------------
Description:
When extracting a key value from a MapType, it calls GetMapValue (complexTypeExtractors.scala) and only use the map type ordering. It should use the resolver instead.
Starting spark with: `{{spark-shell --conf spark.sql.caseSensitive=false`}}
Given dataframe:
{{val df = List(Map("a" -> 1), Map("A" -> 2)).toDF("m")}}
And executing any of these will only return one row: case sensitive match in the keys of the map but case insensitive in the name of the column.
{{df.filter($"M.A".isNotNull).count }}
{{df.filter($"M"("A").isNotNull).count df.filter($"M".getField("A").isNotNull).count}}
was:
When extracting a key value from a MapType, it calls GetMapValue and only use the map type ordering. It should use the resolver instead.
Starting spark with: `{{spark-shell --conf spark.sql.caseSensitive=false`}}
Given dataframe:
{{val df = List(Map("a" -> 1), Map("A" -> 2)).toDF("m")}}
And executing any of these will only return one row: case sensitive match in the keys of the map but case insensitive in the name of the column.
{{df.filter($"M.A".isNotNull).count }}
{{df.filter($"M"("A").isNotNull).count df.filter($"M".getField("A").isNotNull).count}}
> case insensitive resolver should be used in GetMapValue
> -------------------------------------------------------
>
> Key: SPARK-27820
> URL: https://issues.apache.org/jira/browse/SPARK-27820
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.4.1
> Reporter: Michel Lemay
> Priority: Minor
>
> When extracting a key value from a MapType, it calls GetMapValue (complexTypeExtractors.scala) and only use the map type ordering. It should use the resolver instead.
> Starting spark with: `{{spark-shell --conf spark.sql.caseSensitive=false`}}
> Given dataframe:
> {{val df = List(Map("a" -> 1), Map("A" -> 2)).toDF("m")}}
> And executing any of these will only return one row: case sensitive match in the keys of the map but case insensitive in the name of the column.
> {{df.filter($"M.A".isNotNull).count }}
> {{df.filter($"M"("A").isNotNull).count df.filter($"M".getField("A").isNotNull).count}}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org