apache / polaris

The interoperable, open source catalog for Apache Iceberg
http://polaris.io/
Apache License 2.0
1.02k stars 101 forks source link

[BUG] Create View command is failing with Spark console #225

Closed nk1506 closed 1 week ago

nk1506 commented 3 weeks ago

Is this a possible security vulnerability?

Describe the bug

`spark-sql ()> create view db1.v1 as select * from db1.table1;

Catalog polaris does not support views.`

ebyhr commented 3 weeks ago

Does this issue happen even after https://github.com/apache/polaris/pull/216?

nk1506 commented 3 weeks ago

@ebyhr ,Surprisingly, I’m still encountering this error with SparkCLI. I’m currently investigating it. I’m not sure how to assign this bug to myself. Could you help?

collado-mike commented 2 weeks ago

You need to enable Iceberg's spark extensions to create views: see https://github.com/apache/polaris/blob/main/regtests/t_pyspark/src/iceberg_spark.py#L97 for example configuration

nk1506 commented 1 week ago

Thanks @collado-mike for the response. I just tried ./regtests/run_spark_sql.sh and the following script:

create database db1;
show databases;
create table db1.table1 (id int, name string);
insert into db1.table1 values (1, 'a');
select * from db1.table1;
create view db1.v1 as select * from db1.table1;

But it seems working now.