Github user xwu0226 commented on the pull request:

    https://github.com/apache/spark/pull/12716#issuecomment-217264815
  
    @liancheng I added the create view 
[testcases](https://github.com/xwu0226/spark/blob/SPARK_14933/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala#L308-L335)..
  If you see any other issues, please let me know. Thanks!
    
    By the way I also tried `create view` on most recent master branch and 
still can recreate the error:
    
    ```
    scala> spark.sql("create view v_parquet_1 as select * from t_parquet")
    java.lang.UnsupportedOperationException: unsupported plan 
Relation[c1#16,c2#17] HadoopFiles
    
     at 
org.apache.spark.sql.catalyst.SQLBuilder.org$apache$spark$sql$catalyst$SQLBuilder$$toSQL(SQLBuilder.scala:191)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.org$apache$spark$sql$catalyst$SQLBuilder$$toSQL(SQLBuilder.scala:149)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.projectToSQL(SQLBuilder.scala:208)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.org$apache$spark$sql$catalyst$SQLBuilder$$toSQL(SQLBuilder.scala:111)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.org$apache$spark$sql$catalyst$SQLBuilder$$toSQL(SQLBuilder.scala:149)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.projectToSQL(SQLBuilder.scala:208)
     at 
org.apache.spark.sql.catalyst.SQLBuilder.org$apache$spark$sql$catalyst$SQLBuilder$$toSQL(SQLBuilder.scala:111)
     at org.apache.spark.sql.catalyst.SQLBuilder.toSQL(SQLBuilder.scala:81)
     at 
org.apache.spark.sql.execution.command.CreateViewCommand.prepareTable(views.scala:158)
     at 
org.apache.spark.sql.execution.command.CreateViewCommand.run(views.scala:115)
     at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:62)
     at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:60)
     at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:74)
     at 
org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:113)
     at 
org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:113)
     at 
org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:132)
     at 
org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
     at 
org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:129)
     at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:112)
     at 
org.apache.spark.sql.execution.QueryExecution.toRdd$lzycompute(QueryExecution.scala:85)
     at 
org.apache.spark.sql.execution.QueryExecution.toRdd(QueryExecution.scala:85)
     at org.apache.spark.sql.Dataset.<init>(Dataset.scala:186)
     at org.apache.spark.sql.Dataset.<init>(Dataset.scala:167)
     at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:62)
     at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:551)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to