Skip to content

Conversation

@jackylk
Copy link
Contributor

@jackylk jackylk commented Dec 2, 2014

No description provided.

@marmbrus
Copy link
Contributor

marmbrus commented Dec 2, 2014

Thanks for working on this! What about HiveContext?

@marmbrus
Copy link
Contributor

marmbrus commented Dec 2, 2014

ok to test

@SparkQA
Copy link

SparkQA commented Dec 2, 2014

Test build #24051 has finished for PR 3558 at commit 578d167.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@chenghao-intel
Copy link
Contributor

I think we probably have to always keep the HiveContext analyzer case INSENSITIVE, See https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL, Hive will always normalizes the table/view names, columns etc. in DDL actually.

@chenghao-intel
Copy link
Contributor

The change LGTM.

@jackylk
Copy link
Contributor Author

jackylk commented Dec 3, 2014

@chenghao-intel agreed.
Besides, I think the caseSensitive passing to SimpleCatalog also needs to be changed
here: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala#L61

@chenghao-intel
Copy link
Contributor

Great, you're right, please make the change.

@chenghao-intel
Copy link
Contributor

And it will be nice if you can also add test suite for this.

@jackylk
Copy link
Contributor Author

jackylk commented Dec 3, 2014

testcase added. Since analyzer's caseSensitive variable can't be modified after initialization, I am creating another test suite instead of using SQLQuerySuite.

@SparkQA
Copy link

SparkQA commented Dec 3, 2014

Test build #24096 has finished for PR 3558 at commit f57f15c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@chenghao-intel
Copy link
Contributor

Yeah, that's problem, we probably has 2 ways for this:

  • Make the analyzer as function, not lazy val in SqlContext
  • Take the SqlContext or SqlConfas parameter in constructing Analyzer, instead of the caseSensetive

I prefer the second way, what do you think @marmbrus @jackylk ?

@scwf
Copy link
Contributor

scwf commented Dec 4, 2014

The second way +1, because maybe future we need other configs in analyzer

@jackylk
Copy link
Contributor Author

jackylk commented Dec 6, 2014

If we go for second way, it will create cyclic dependency between spark-catalyst and spark-sql sub-projects, because SQLConf and SQLContext is in spark-sql while Analyzer is in spark-catalyst.
I think the current way the only drawback is that caseSensitive can only be set while initializing SQLContext, but can not be set after initialization. If client want to use case insensitive analyzer, he need to create a new SQLContext, which I think it is probably OK.
I tested this way locally and it is passing SQLQuerySuite, I do not know why test case failed, as I can not access Jenkins test report now. Can anyone trigger Jenkins again, thanks.
And any more suggestion for better solution?

@chenghao-intel
Copy link
Contributor

That's a good point, Can we make another interface that SqlConf inherit from? Or can we move the SqlConf into the module Catalyst? Any other idea?

@marmbrus
Copy link
Contributor

I like the idea of having a configuration interface in catalyst that SQLConf can inherit from. We can then pass that into the analyzer.

I do want the HiveContext to be configurable as well since it should be a super set of what you can do with SQLContext. By default it should be case insensitive to match Hive.

@SparkQA
Copy link

SparkQA commented Dec 20, 2014

Test build #24671 has finished for PR 3558 at commit 91b1b96.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 20, 2014

Test build #24672 has finished for PR 3558 at commit 210915f.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 20, 2014

Test build #24674 has finished for PR 3558 at commit e7bca31.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@jackylk
Copy link
Contributor Author

jackylk commented Dec 20, 2014

modified according to @marmbrus, a CatalystConf trait is added and used in Analyzer and Catalog

@SparkQA
Copy link

SparkQA commented Dec 20, 2014

Test build #24675 has finished for PR 3558 at commit fcbf0d9.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 20, 2014

Test build #24673 has finished for PR 3558 at commit 578d167.

  • This patch fails Spark unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@marmbrus
Copy link
Contributor

ping

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25011 has finished for PR 3558 at commit 8753610.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25013 has finished for PR 3558 at commit 005c56d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25014 has finished for PR 3558 at commit 9bf4cc7.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25015 has finished for PR 3558 at commit 73c16b1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@marmbrus
Copy link
Contributor

I think this should probably go in after #3965. We can have some parent trait in catalyst that the SQL version can extend. That way we can just pass the configuration we use in SQL back to catalyst.

@jackylk
Copy link
Contributor Author

jackylk commented Jan 19, 2015

I have updated the code based on SPARK-5168 (#3965)

@SparkQA
Copy link

SparkQA commented Jan 19, 2015

Test build #25751 has finished for PR 3558 at commit 05b09a3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Jan 19, 2015

Test build #25755 has finished for PR 3558 at commit dee56e9.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@jackylk
Copy link
Contributor Author

jackylk commented Jan 21, 2015

Please run the test again. I tested all sql and hive test case locally, and no error is reported. I am not sure why online test fails

@SparkQA
Copy link

SparkQA commented Feb 3, 2015

Test build #26660 has finished for PR 3558 at commit 39e369c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Feb 21, 2015

Test build #27815 has finished for PR 3558 at commit 12eca9a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

@SparkQA
Copy link

SparkQA commented Feb 21, 2015

Test build #27816 has finished for PR 3558 at commit 664d1e9.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the catalyst conf can be as simple as a set of abstract methods that need to be implemented by some concrete conf.

trait CatalystConf {
  def caseSensitiveAnalysis: Boolean
}

We can have a trivial one for testing: case class SimpleConf(caseSensitiveAnalysis: Boolean) extends CatalystConf and SQLConf can mix this trait in as you are already doing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, most interfaces in catalyst are not private since this package is not part of our standard compatibility guarantees.

@marmbrus
Copy link
Contributor

marmbrus commented Apr 3, 2015

ping.

Thanks for working on this! However, to keep the PR queue small, I propose we close this issue until you have time to update it.

asfgit pushed a commit that referenced this pull request May 8, 2015
based on #3558

Author: Jacky Li <[email protected]>
Author: wangfei <[email protected]>
Author: scwf <[email protected]>

Closes #5806 from scwf/case and squashes the following commits:

cd51712 [wangfei] fix compile
d4b724f [wangfei] address michael's comment
af512c7 [wangfei] fix conflicts
4ef1be7 [wangfei] fix conflicts
269cf21 [scwf] fix conflicts
b73df6c [scwf] style issue
9e11752 [scwf] improve SimpleCatalystConf
b35529e [scwf] minor style
a3f7659 [scwf] remove unsed imports
2a56515 [scwf] fix conflicts
6db4bf5 [scwf] also fix for HiveContext
7fc4a98 [scwf] fix test case
d5a9933 [wangfei] fix style
eee75ba [wangfei] fix EmptyConf
6ef31cf [wangfei] revert pom changes
5d7c456 [wangfei] set CASE_SENSITIVE false in TestHive
966e719 [wangfei] set CASE_SENSITIVE false in hivecontext
fd30e25 [wangfei] added override
69b3b70 [wangfei] fix AnalysisSuite
5472b08 [wangfei] fix compile issue
56034ca [wangfei] fix conflicts and improve for catalystconf
664d1e9 [Jacky Li] Merge branch 'master' of https://github.com/apache/spark into case
12eca9a [Jacky Li] solve conflict with master
39e369c [Jacky Li] fix confilct after DataFrame PR
dee56e9 [Jacky Li] fix test case failure
05b09a3 [Jacky Li] fix conflict base on the latest master branch
73c16b1 [Jacky Li] fix bug in sql/hive
9bf4cc7 [Jacky Li] fix bug in catalyst
005c56d [Jacky Li] make SQLContext caseSensitivity configurable
6332e0f [Jacky Li] fix bug
fcbf0d9 [Jacky Li] fix scalastyle check
e7bca31 [Jacky Li] make caseSensitive configuration in Analyzer and Catalog
91b1b96 [Jacky Li] make caseSensitive configurable in Analyzer
f57f15c [Jacky Li] add testcase
578d167 [Jacky Li] make caseSensitive configurable

(cherry picked from commit 6dad76e)
Signed-off-by: Michael Armbrust <[email protected]>
asfgit pushed a commit that referenced this pull request May 8, 2015
based on #3558

Author: Jacky Li <[email protected]>
Author: wangfei <[email protected]>
Author: scwf <[email protected]>

Closes #5806 from scwf/case and squashes the following commits:

cd51712 [wangfei] fix compile
d4b724f [wangfei] address michael's comment
af512c7 [wangfei] fix conflicts
4ef1be7 [wangfei] fix conflicts
269cf21 [scwf] fix conflicts
b73df6c [scwf] style issue
9e11752 [scwf] improve SimpleCatalystConf
b35529e [scwf] minor style
a3f7659 [scwf] remove unsed imports
2a56515 [scwf] fix conflicts
6db4bf5 [scwf] also fix for HiveContext
7fc4a98 [scwf] fix test case
d5a9933 [wangfei] fix style
eee75ba [wangfei] fix EmptyConf
6ef31cf [wangfei] revert pom changes
5d7c456 [wangfei] set CASE_SENSITIVE false in TestHive
966e719 [wangfei] set CASE_SENSITIVE false in hivecontext
fd30e25 [wangfei] added override
69b3b70 [wangfei] fix AnalysisSuite
5472b08 [wangfei] fix compile issue
56034ca [wangfei] fix conflicts and improve for catalystconf
664d1e9 [Jacky Li] Merge branch 'master' of https://github.com/apache/spark into case
12eca9a [Jacky Li] solve conflict with master
39e369c [Jacky Li] fix confilct after DataFrame PR
dee56e9 [Jacky Li] fix test case failure
05b09a3 [Jacky Li] fix conflict base on the latest master branch
73c16b1 [Jacky Li] fix bug in sql/hive
9bf4cc7 [Jacky Li] fix bug in catalyst
005c56d [Jacky Li] make SQLContext caseSensitivity configurable
6332e0f [Jacky Li] fix bug
fcbf0d9 [Jacky Li] fix scalastyle check
e7bca31 [Jacky Li] make caseSensitive configuration in Analyzer and Catalog
91b1b96 [Jacky Li] make caseSensitive configurable in Analyzer
f57f15c [Jacky Li] add testcase
578d167 [Jacky Li] make caseSensitive configurable
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 28, 2015
based on apache#3558

Author: Jacky Li <[email protected]>
Author: wangfei <[email protected]>
Author: scwf <[email protected]>

Closes apache#5806 from scwf/case and squashes the following commits:

cd51712 [wangfei] fix compile
d4b724f [wangfei] address michael's comment
af512c7 [wangfei] fix conflicts
4ef1be7 [wangfei] fix conflicts
269cf21 [scwf] fix conflicts
b73df6c [scwf] style issue
9e11752 [scwf] improve SimpleCatalystConf
b35529e [scwf] minor style
a3f7659 [scwf] remove unsed imports
2a56515 [scwf] fix conflicts
6db4bf5 [scwf] also fix for HiveContext
7fc4a98 [scwf] fix test case
d5a9933 [wangfei] fix style
eee75ba [wangfei] fix EmptyConf
6ef31cf [wangfei] revert pom changes
5d7c456 [wangfei] set CASE_SENSITIVE false in TestHive
966e719 [wangfei] set CASE_SENSITIVE false in hivecontext
fd30e25 [wangfei] added override
69b3b70 [wangfei] fix AnalysisSuite
5472b08 [wangfei] fix compile issue
56034ca [wangfei] fix conflicts and improve for catalystconf
664d1e9 [Jacky Li] Merge branch 'master' of https://github.com/apache/spark into case
12eca9a [Jacky Li] solve conflict with master
39e369c [Jacky Li] fix confilct after DataFrame PR
dee56e9 [Jacky Li] fix test case failure
05b09a3 [Jacky Li] fix conflict base on the latest master branch
73c16b1 [Jacky Li] fix bug in sql/hive
9bf4cc7 [Jacky Li] fix bug in catalyst
005c56d [Jacky Li] make SQLContext caseSensitivity configurable
6332e0f [Jacky Li] fix bug
fcbf0d9 [Jacky Li] fix scalastyle check
e7bca31 [Jacky Li] make caseSensitive configuration in Analyzer and Catalog
91b1b96 [Jacky Li] make caseSensitive configurable in Analyzer
f57f15c [Jacky Li] add testcase
578d167 [Jacky Li] make caseSensitive configurable
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
based on apache#3558

Author: Jacky Li <[email protected]>
Author: wangfei <[email protected]>
Author: scwf <[email protected]>

Closes apache#5806 from scwf/case and squashes the following commits:

cd51712 [wangfei] fix compile
d4b724f [wangfei] address michael's comment
af512c7 [wangfei] fix conflicts
4ef1be7 [wangfei] fix conflicts
269cf21 [scwf] fix conflicts
b73df6c [scwf] style issue
9e11752 [scwf] improve SimpleCatalystConf
b35529e [scwf] minor style
a3f7659 [scwf] remove unsed imports
2a56515 [scwf] fix conflicts
6db4bf5 [scwf] also fix for HiveContext
7fc4a98 [scwf] fix test case
d5a9933 [wangfei] fix style
eee75ba [wangfei] fix EmptyConf
6ef31cf [wangfei] revert pom changes
5d7c456 [wangfei] set CASE_SENSITIVE false in TestHive
966e719 [wangfei] set CASE_SENSITIVE false in hivecontext
fd30e25 [wangfei] added override
69b3b70 [wangfei] fix AnalysisSuite
5472b08 [wangfei] fix compile issue
56034ca [wangfei] fix conflicts and improve for catalystconf
664d1e9 [Jacky Li] Merge branch 'master' of https://github.com/apache/spark into case
12eca9a [Jacky Li] solve conflict with master
39e369c [Jacky Li] fix confilct after DataFrame PR
dee56e9 [Jacky Li] fix test case failure
05b09a3 [Jacky Li] fix conflict base on the latest master branch
73c16b1 [Jacky Li] fix bug in sql/hive
9bf4cc7 [Jacky Li] fix bug in catalyst
005c56d [Jacky Li] make SQLContext caseSensitivity configurable
6332e0f [Jacky Li] fix bug
fcbf0d9 [Jacky Li] fix scalastyle check
e7bca31 [Jacky Li] make caseSensitive configuration in Analyzer and Catalog
91b1b96 [Jacky Li] make caseSensitive configurable in Analyzer
f57f15c [Jacky Li] add testcase
578d167 [Jacky Li] make caseSensitive configurable
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
based on apache#3558

Author: Jacky Li <[email protected]>
Author: wangfei <[email protected]>
Author: scwf <[email protected]>

Closes apache#5806 from scwf/case and squashes the following commits:

cd51712 [wangfei] fix compile
d4b724f [wangfei] address michael's comment
af512c7 [wangfei] fix conflicts
4ef1be7 [wangfei] fix conflicts
269cf21 [scwf] fix conflicts
b73df6c [scwf] style issue
9e11752 [scwf] improve SimpleCatalystConf
b35529e [scwf] minor style
a3f7659 [scwf] remove unsed imports
2a56515 [scwf] fix conflicts
6db4bf5 [scwf] also fix for HiveContext
7fc4a98 [scwf] fix test case
d5a9933 [wangfei] fix style
eee75ba [wangfei] fix EmptyConf
6ef31cf [wangfei] revert pom changes
5d7c456 [wangfei] set CASE_SENSITIVE false in TestHive
966e719 [wangfei] set CASE_SENSITIVE false in hivecontext
fd30e25 [wangfei] added override
69b3b70 [wangfei] fix AnalysisSuite
5472b08 [wangfei] fix compile issue
56034ca [wangfei] fix conflicts and improve for catalystconf
664d1e9 [Jacky Li] Merge branch 'master' of https://github.com/apache/spark into case
12eca9a [Jacky Li] solve conflict with master
39e369c [Jacky Li] fix confilct after DataFrame PR
dee56e9 [Jacky Li] fix test case failure
05b09a3 [Jacky Li] fix conflict base on the latest master branch
73c16b1 [Jacky Li] fix bug in sql/hive
9bf4cc7 [Jacky Li] fix bug in catalyst
005c56d [Jacky Li] make SQLContext caseSensitivity configurable
6332e0f [Jacky Li] fix bug
fcbf0d9 [Jacky Li] fix scalastyle check
e7bca31 [Jacky Li] make caseSensitive configuration in Analyzer and Catalog
91b1b96 [Jacky Li] make caseSensitive configurable in Analyzer
f57f15c [Jacky Li] add testcase
578d167 [Jacky Li] make caseSensitive configurable
@JoshRosen
Copy link
Contributor

This was fixed by #5806, so I think we can close this issue / PR.

@asfgit asfgit closed this in 804a012 Sep 4, 2015
Sign up for free to 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.

6 participants