Skip to content

[SPARK-13493][SQL] Enable case sensitiveness in json schema inference. - #11420

Closed
zuowang wants to merge 1 commit into
apache:masterfrom
zuowang:case-sensitiveness-4-json
Closed

[SPARK-13493][SQL] Enable case sensitiveness in json schema inference.#11420
zuowang wants to merge 1 commit into
apache:masterfrom
zuowang:case-sensitiveness-4-json

Conversation

@zuowang

Copy link
Copy Markdown

What changes were proposed in this pull request?

Pass "caseSensitiveAnalysis" to InferSchema. Change field name to lowercase when "caseSensitiveAnalysis" is false.

How was this patch tested?

Add new test case in DataFrameSuite.

@zuowang

Copy link
Copy Markdown
Author

What would be the case like in CSV? I don't think anybody want to conbine "user" and "User" column when "caseSensitiveAnalysis" is false.
scala> val jsonDF = sqlContext.read.option("header", "true").csv("file.csv")
jsonDF: org.apache.spark.sql.DataFrame = [user: string, User: string ... 1 more field]

scala> jsonDF.show
+-------+-------+-----+
| user| User| hits|
+-------+-------+-----+
| om| scala| 120|
| daniel| spark| 80|
|3754978| spark| 1|
+-------+-------+-----+

Pass "caseSensitiveAnalysis" to InferSchema. Change field name to lowercase when "caseSensitiveAnalysis" is false.
Add new test case in DataFrameSuite.
@zuowang
zuowangforce-pushed the case-sensitiveness-4-json branch from 7c76be4 to fe17374CompareMarch 8, 2016 10:22
@maropu

maropu commented Jun 17, 2016

Copy link
Copy Markdown
Member

@rxin Currently, do we have any policy to handle case-sensitivity inside spark? e.g., postgresql always holds names into lower case (https://www.postgresql.org/docs/9.5/static/sql-syntax-lexical.html) and h2 does into upper one. It seems there are many case-sensitivity issue in not only json, but also other other datasources.

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@gatorsmile

Copy link
Copy Markdown
Member

@maropu Yes. We need to consider case sensitivity for the built-in data sources at least.

@gatorsmile

Copy link
Copy Markdown
Member

@zuowang@maropu Are you still working on this? We should resolve this issue.

@maropu

Copy link
Copy Markdown
Member

I'm not, so it's okay to do so.

@zuowang

Copy link
Copy Markdown
Author

I'm not, could you work to resolve it?

@HyukjinKwon

Copy link
Copy Markdown
Member

Let's close this if it is not in a progress.

@HyukjinKwonHyukjinKwon mentioned this pull request Jun 25, 2017
@gatorsmile

Copy link
Copy Markdown
Member

We are closing it due to inactivity. please do reopen if you want to push it forward. Thanks!

zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
## What changes were proposed in this pull request?
This PR proposes to close stale PRs, mostly the same instances with apache#18017
I believe the author in apache#14807 removed his account.
Closesapache#7075Closesapache#8927Closesapache#9202Closesapache#9366Closesapache#10861Closesapache#11420Closesapache#12356Closesapache#13028Closesapache#13506Closesapache#14191Closesapache#14198Closesapache#14330Closesapache#14807Closesapache#15839Closesapache#16225Closesapache#16685Closesapache#16692Closesapache#16995Closesapache#17181Closesapache#17211Closesapache#17235Closesapache#17237Closesapache#17248Closesapache#17341Closesapache#17708Closesapache#17716Closesapache#17721Closesapache#17937
Added:
Closesapache#14739Closesapache#17139Closesapache#17445Closesapache#18042Closesapache#18359
Added:
Closesapache#16450Closesapache#16525Closesapache#17738
Added:
Closesapache#16458Closesapache#16508Closesapache#17714
Added:
Closesapache#17830Closesapache#14742
## How was this patch tested?
N/A
Author: hyukjinkwon <gurwls223@gmail.com>
Closesapache#18417 from HyukjinKwon/close-stale-pr.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@zuowang@maropu@AmplabJenkins@gatorsmile@HyukjinKwon