-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-12668][SQL] Providing aliases for CSV options to be similar to Pandas and R #10800
Conversation
@HyukjinKwon please do not replace existing option names. Please just provide aliases. This can be done entirely inside |
@falaki Ah, right. |
@@ -44,9 +44,9 @@ private[sql] case class CSVParameters(parameters: Map[String, String]) extends L | |||
} | |||
} | |||
|
|||
val delimiter = CSVTypeCast.toChar(parameters.getOrElse("delimiter", ",")) | |||
val seq = CSVTypeCast.toChar(parameters.getOrElse("seq", ",")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is "sep", not "seq".
Also I like the old name for the variable better. We should just rename the name for the option. And for backward compatibility, we should accept "delimiter" if "sep" is not set.
Do you know what happened to the compression codec? |
Sorry that I misunderstood the issue patch. For |
It'd be good to support that - but maybe we can do it in a separate pr. |
Sure. Do you think it would be great if JSON datasource has that one as well? |
Yes I think so. But let's do that as a separate thing. |
Test build #49572 has finished for PR 10800 at commit
|
Hm.. Do you know anything about the test
I am looking into this though. I just wonder if you know already. |
Ah.. this was because it was not serializanle due to |
Test build #49587 has finished for PR 10800 at commit
|
@@ -44,9 +44,11 @@ private[sql] case class CSVParameters(parameters: Map[String, String]) extends L | |||
} | |||
} | |||
|
|||
val delimiter = CSVTypeCast.toChar(parameters.getOrElse("delimiter", ",")) | |||
val delimiter = CSVTypeCast.toChar( | |||
parameters.getOrElse("delimiter", parameters.getOrElse("sep", ","))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should take sep first, and then delimiter, since sep is the new canonical option now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while you are at it, can you make parameters map transient, and make it not a case class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
@rxin Can I make it like |
Test build #49652 has finished for PR 10800 at commit
|
Test build #49653 has finished for PR 10800 at commit
|
This style failure is occuring in |
This was because of [HOT][BUILD] Changed the import order. |
Test build #49658 has finished for PR 10800 at commit
|
Thanks - I'm going to merge this. |
https://issues.apache.org/jira/browse/SPARK-12668
Spark CSV datasource has been being merged (filed in SPARK-12420). This is a quicky PR that simply renames several CSV options to similar Pandas and R.