Skip to content

Conversation

@yanboliang
Copy link
Contributor

Initial code snippet for Describe Table command

  1. SQL Parser and generate logical plan. Add "DESCRIBE [FORMATTED] [db_name.]table_name" command parser in DDLParser and generate the same logical plan for both SQLContext and HiveContext.
    (note: HiveContext also support "DESCRIBE [FORMATTED] [db_name.]table_name PARTITION partition_column_name" and "DESCRIBE [FORMATTED] [db_name.]table_name column_name" is implement by Hive native command)
  2. Implement DescribeCommand which invoke by RunnableCommand.
  3. For SQLContext the code is clearly structured, but for HiveContext the output of describe command need to stay the same Hive. So For HiveContext, we still transfer logical command to DescribeHiveTableCommand which had been implement in HiveStrategies.HiveCommandStrategy.

@yanboliang yanboliang changed the title Implement Describe Table for SQLContext [SQL] Implement Describe Table for SQLContext Jan 26, 2015
@yanboliang
Copy link
Contributor Author

@SparkQA
Copy link

SparkQA commented Jan 26, 2015

Test build #26095 has started for PR 4207 at commit 7fb2e81.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 26, 2015

Test build #26095 has finished for PR 4207 at commit 7fb2e81.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26095/
Test FAILed.

@SparkQA
Copy link

SparkQA commented Jan 26, 2015

Test build #26096 has started for PR 4207 at commit 34508a3.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 26, 2015

Test build #26096 has finished for PR 4207 at commit 34508a3.

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

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26096/
Test FAILed.

@SparkQA
Copy link

SparkQA commented Jan 27, 2015

Test build #26158 has started for PR 4207 at commit 27c449d.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 27, 2015

Test build #26158 has finished for PR 4207 at commit 27c449d.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26158/
Test PASSed.

@yanboliang
Copy link
Contributor Author

Move Describe command parser to DDLParser which can implement do not throw error when parse exception. So that some HiveContext particular describe command can be parse by fallback Hive parser and run by Hive native command.

@lianhuiwang
Copy link
Contributor

firstly,we need to rename title of PR to [SPARK-5324][SQL] Implement Describe Table for SQLContext. i find that code of this PR is not the latest code. i donot agree that move DescribeCommand to a class of SparkPlan. it keep to be a class of LogicalPlan.
in Hive Context, it have implemented DescribeHiveTableCommand of SparkPlan. so in SQL Context, we just need to implement a SparkPlan like DescribeHiveTableCommand of Hive Context. and in CommandStrategy of SparkStrategies will translate Describe's LogicalPlan to SparkPlan.

@rxin
Copy link
Contributor

rxin commented Jan 28, 2015

Thanks for submitting the pull request. Are these two PRs working on the same thing? #4227 Would be great if you two can chime in on each other's PR.

@OopsOutOfMemory
Copy link
Contributor

hi, @yanbohappy, I've already worked in this.
For your PR, I took a look at it. But I think it's a little hacky to me. Would you like to review mine?

Copy link
Contributor

Choose a reason for hiding this comment

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

IntegerType and StringType ? should be int, string

@OopsOutOfMemory
Copy link
Contributor

hi, @yanbohappy Thanks for working on this. But by the way, this JIRA(SPARK-5324) Results of describe can't be queried is mainly focus on make describe command can be query like a table but not Add a describe command in sqlContext, shall we make this PR focus on it's own JIRA issue? And you have no more test suites to demonstrate bug fixing. Would you mind close this PR, and if you have some good advices for add describe table you can refer to SPARK-5135 #4227 , and comment on my PR. I'd be very pleasure : )

@yanboliang
Copy link
Contributor Author

@lianhuiwang In this PR #3948, CommandStrategy had been removed and command had been refactor.

@yanboliang
Copy link
Contributor Author

@OopsOutOfMemory Since you have go deep into this issue and I agree your PR is more mature. So close this one.

@yanboliang yanboliang closed this Jan 28, 2015
@yanboliang yanboliang deleted the spark-5324 branch January 28, 2015 08:09
@rxin
Copy link
Contributor

rxin commented Jan 28, 2015

@yanbohappy thanks for the discussion.

@OopsOutOfMemory
Copy link
Contributor

@yanbohappy thanks for the discussion and the work efforts : )

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