presto kafka create view error: This connector does not support creating views

352 views
Skip to first unread message

lurenx

unread,
Oct 10, 2016, 10:54:38 PM10/10/16
to Presto
hello. 
       when i use presto-kafka connector . i want to create a view from  the  kafka topic like following ,but  i meet a  problem.
        
==============================================================================================================
[root@t-server28 bin]# ./presto-cli-0.147-executable.jar --server localhost:8769 --catalog kafka  --debug
presto> show schemas from kafka;
       Schema
--------------------
 default
 information_schema
 tpch
(3 rows)

Query 20161011_025212_00022_r8jzy, FINISHED, 2 nodes
Splits: 2 total, 2 done (100.00%)
CPU Time: 0.0s total,   750 rows/s, 11.7KB/s, 14% active
Per Node: 0.0 parallelism,     7 rows/s,   119B/s
Parallelism: 0.0
0:00 [3 rows, 48B] [14 rows/s, 238B/s]

presto> use tpch;
presto:tpch> show tables;
  Table
----------
 customer
 lineitem
 nation
 orders
 part
 partsupp
 region
 supplier
(8 rows)

Query 20161011_025228_00025_r8jzy, FINISHED, 2 nodes
Splits: 2 total, 1 done (50.00%)
CPU Time: 0.0s total,    8K rows/s,  170KB/s, 20% active
Per Node: 0.0 parallelism,    18 rows/s,   392B/s
Parallelism: 0.0
0:00 [8 rows, 174B] [36 rows/s, 784B/s]

presto:tpch> select * from customer limit 1;
 _partition_id | _partition_offset | _segment_start | _segment_end | _segment_count | _key | _key_corrupt | _key_length |
---------------+-------------------+----------------+--------------+----------------+------+--------------+-------------+-----------------------------------------------------------
             0 |                 0 |              0 |         1500 |              1 | ^@^@^@^@^@^@^@^@     | false        |           8 | {"rowNumber":1,"customerKey":1,"name":"Cus
(1 row)

Query 20161011_025239_00026_r8jzy, FINISHED, 2 nodes
Splits: 2 total, 0 done (0.00%)
CPU Time: 0.0s total,     0 rows/s,     0B/s, 0% active
Per Node: 0.0 parallelism,     0 rows/s,     0B/s
Parallelism: 0.0
0:02 [0 rows, 0B] [0 rows/s, 0B/s]

presto:tpch> create view customer_view as select * from customer;
Query 20161011_025310_00027_r8jzy failed: This connector does not support creating views
com.facebook.presto.spi.PrestoException: This connector does not support creating views
at com.facebook.presto.spi.connector.ConnectorMetadata.createView(ConnectorMetadata.java:238)
at com.facebook.presto.metadata.MetadataManager.createView(MetadataManager.java:684)
at com.facebook.presto.execution.CreateViewTask.execute(CreateViewTask.java:101)
at com.facebook.presto.execution.CreateViewTask.execute(CreateViewTask.java:48)
at com.facebook.presto.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:104)
at com.facebook.presto.execution.QueuedExecution.lambda$start$1(QueuedExecution.java:68)
at com.facebook.presto.execution.QueuedExecution$$Lambda$366/1314960833.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

presto:tpch>
============================================================================================================================
how  can i resolve the problem? thank you all.


lurenx

unread,
Oct 10, 2016, 11:42:56 PM10/10/16
to Presto
I have resolve the  problem;

create view on  hive catalog, not on  kafka

==============================================================================
[root@t-server28 bin]# ./presto-cli-0.147-executable.jar --server localhost:8769 --catalog hive
presto> show schemas from kafka.tpch;
Query 20161011_033641_00047_r8jzy failed: line 1:24: mismatched input '.' expecting <EOF>
show schemas from kafka.tpch

presto> show tables from kafka.tpch;
  Table
----------
 customer
 lineitem
 nation
 orders
 part
 partsupp
 region
 supplier
(8 rows)
presto> use default;
presto:default> create view view_test as select * from kafka.tpch.customer;
CREATE VIEW
============================================================================================
Reply all
Reply to author
Forward
0 new messages