You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Marco Gaido (JIRA)" <ji...@apache.org> on 2019/06/22 14:35:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16870286#comment-16870286 ] 

Marco Gaido commented on SPARK-27820:
-------------------------------------

+1 for [~hyukjin.kwon]'s comment.

> 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 insensitive in the name of the column but case sensitive match in the keys of the map.
> {{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