junsionzhang removed a comment on issue #1684:
URL: https://github.com/apache/iceberg/issues/1684#issuecomment-808012631


   > Hi @paulzanmei
   > 
   > I tried your case on my local host, I did not query the hive catalog table 
( which is created in flink sql) in hive sql successfully, but I did the 
similar thing successfully for hadoop table. Say the following steps would work:
   > 
   > Step#1 : Create a hadoop catalog/database/table in flink sql and then 
write one record:
   > 
   > ```shell
   > Flink SQL> CREATE CATALOG hadoop_catalog WITH (
   > >   'type'='iceberg',
   > >   'catalog-type'='hadoop',
   > >   'clients'='5',
   > >   'warehouse'='file:///Users/openinx/test/hive-warehouse1'
   > > );
   > [INFO] Catalog has been created.
   > 
   > Flink SQL> show databases;
   > default_database
   > 
   > Flink SQL> show tables; 
   > [INFO] Result was empty.
   > 
   > Flink SQL> use catalog hadoop_catalog; 
   > 
   > Flink SQL> show tables;
   > sample
   > 
   > Flink SQL> insert into sample select 1, 'a';
   > [INFO] Submitting SQL update statement to the cluster...
   > [INFO] Table update statement has been successfully submitted to the 
cluster:
   > Job ID: 4b4b8c2b1a8d6f876a56f55abe4de1fe
   > ```
   > 
   > Step#2: Create an external hive table in hive shell:
   > 
   > ```sql
   > CREATE EXTERNAL TABLE sample_mirror2
   > STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler'
   > LOCATION 'file:///Users/openinx/test/hive-warehouse1/default/sample';
   > ```
   > 
   > And show tables:
   > 
   > ```
   > show tables; 
   > 
   > +-----------------+
   > |    tab_name     |
   > +-----------------+
   > | sample_mirror2  |
   > +-----------------+
   > 1 rows selected (0.056 seconds)
   > ```
   > 
   > Step#3: Query the records in hive shell:
   > 
   > ```sql
   > select * from sample_mirror2;
   > 
   > +--------------------+----------------------+
   > | sample_mirror2.id  | sample_mirror2.data  |
   > +--------------------+----------------------+
   > | 1                  | a                    |
   > +--------------------+----------------------+
   > 1 row selected (0.86 seconds)
   > ```
   > 
   > I will figure out why it does not work for hive catalog table. @paulzanmei 
FYI
   
   hi, have you figured out the reason now ?  @JingsongLi  said 'Hive reader 
only supports read a existed Hadoop table...' ,but I think the 
link(https://iceberg.apache.org/hive/) does not say it clearly .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to