Skip to content

Conversation

@gatorsmile
Copy link
Member

What changes were proposed in this pull request?

Because the concept of partitioning is associated with physical tables, we disable all the supports of partitioned views, which are defined in the following three commands in Hive DDL Manual:

ALTER VIEW view DROP [IF EXISTS] PARTITION spec1[, PARTITION spec2, ...];

ALTER VIEW view ADD [IF NOT EXISTS] PARTITION spec;

CREATE VIEW [IF NOT EXISTS] [db_name.]view_name [(column_name [COMMENT column_comment], ...) ]
  [COMMENT view_comment]
  [TBLPROPERTIES (property_name = property_value, ...)]
  AS SELECT ...;

An exception is thrown when users issue any of these three DDL commands.

How was this patch tested?

Added test cases for parsing create view and changed the existing test cases to verify if the exceptions are thrown.

gatorsmile and others added 30 commits November 13, 2015 14:50
| ALTER TABLE tableIdentifier
SET SKEWED LOCATION skewedLocationList #setTableSkewLocations
| ALTER TABLE tableIdentifier ADD (IF NOT EXISTS)?
| ALTER kind=TABLE tableIdentifier ADD (IF NOT EXISTS)?
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: we don't really need kind. We can also just check for the existance of the VIEW keyword, e.g.: ctx.VIEW != null.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Will do.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54959 has finished for PR 12169 at commit b6c1601.

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

# Conflicts:
#	sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDDLCommandSuite.scala
@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54983 has finished for PR 12169 at commit 140f859.

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

@gatorsmile
Copy link
Member Author

Thanks for the review! @hvanhovell

Also cc @yhuai @andrewor14

*/
override def visitAddTablePartition(
ctx: AddTablePartitionContext): LogicalPlan = withOrigin(ctx) {
if (ctx.VIEW != null) throw new ParseException(s"Unsupported partitioned view", ctx)
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 @yhuai prefers to say something like Operation not allowed: partitioned views for the message (here and everywhere else)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do it now. Thanks!

@andrewor14
Copy link
Contributor

Looks pretty good, just a minor comment.

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #55031 has finished for PR 12169 at commit e5a8de7.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • s\"its class is $
    • s\"Unable to generate an encoder for inner class$`
    • case class UnresolvedGenerator(name: String, children: Seq[Expression]) extends Generator
    • case class UnresolvedDeserializer(deserializer: Expression, inputAttributes: Seq[Attribute])
    • case class FunctionResource(resourceType: FunctionResourceType, uri: String)
    • trait FunctionResourceLoader
    • case class CatalogFunction(
    • case class CreateFunction(
    • case class DropFunction(
    • case class StreamingRelation(dataSource: DataSource, sourceName: String, output: Seq[Attribute])
    • case class StreamingExecutionRelation(source: Source, output: Seq[Attribute]) extends LeafNode

@andrewor14
Copy link
Contributor

Build is broken I think. retest this please

* }}}
*/
override def visitCreateView(ctx: CreateViewContext): LogicalPlan = withOrigin(ctx) {
// Pass a partitioned view on to hive.
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be deleted

@andrewor14
Copy link
Contributor

LGTM we just need to make tests pass now

@SparkQA
Copy link

SparkQA commented Apr 6, 2016

Test build #55049 has finished for PR 12169 at commit e5a8de7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • s\"its class is $
    • s\"Unable to generate an encoder for inner class$`
    • case class UnresolvedGenerator(name: String, children: Seq[Expression]) extends Generator
    • case class UnresolvedDeserializer(deserializer: Expression, inputAttributes: Seq[Attribute])
    • case class FunctionResource(resourceType: FunctionResourceType, uri: String)
    • trait FunctionResourceLoader
    • case class CatalogFunction(
    • case class CreateFunction(
    • case class DropFunction(
    • case class StreamingRelation(dataSource: DataSource, sourceName: String, output: Seq[Attribute])
    • case class StreamingExecutionRelation(source: Source, output: Seq[Attribute]) extends LeafNode

@SparkQA
Copy link

SparkQA commented Apr 6, 2016

Test build #55072 has finished for PR 12169 at commit 93e51b4.

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

@andrewor14
Copy link
Contributor

Merged into master.

@asfgit asfgit closed this in 68be5b9 Apr 6, 2016
@yhuai
Copy link
Contributor

yhuai commented Apr 6, 2016

@gatorsmile Seems scala 2.10 build is broken. Can you take a look?

@gatorsmile
Copy link
Member Author

Sure. Could you show me how to find the build log?

@gatorsmile
Copy link
Member Author

Or I need to do it in my local environment?

@gatorsmile
Copy link
Member Author

@gatorsmile
Copy link
Member Author

I see the problem.

[error] /home/jenkins/workspace/spark-master-compile-maven-scala-2.10/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDDLCommandSuite.scala:266: value contains is not a member of Option[String]
[error]     assert(desc.viewText.contains("SELECT * FROM tab1"))
[error]                          ^
[error] /home/jenkins/workspace/spark-master-compile-maven-scala-2.10/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDDLCommandSuite.scala:267: value contains is not a member of Option[String]
[error]     assert(desc.viewOriginalText.contains("SELECT * FROM tab1"))
[error]                                  ^
[error] /home/jenkins/workspace/spark-master-compile-maven-scala-2.10/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDDLCommandSuite.scala:293: value contains is not a member of Option[String]
[error]     assert(desc.viewText.contains("SELECT * FROM tab1"))
[error]                          ^
[error] /home/jenkins/workspace/spark-master-compile-maven-scala-2.10/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDDLCommandSuite.scala:294: value contains is not a member of Option[String]
[error]     assert(desc.viewOriginalText.contains("SELECT * FROM tab1"))
[error]                                  ^
[error] four errors found
[error] Compile failed at Apr 5, 2016 10:59:09 PM [10.502s]

@gatorsmile
Copy link
Member Author

Will fix it using a PR with [HOT]. Sorry for it.

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