0
<https://stackoverflow.com/posts/68907086/timeline>

I tried to read the data from hive table using the flink sql client as per
the flink documentation
<https://ci.apache.org/projects/flink/flink-docs-master/docs/connectors/table/hive/hive_catalog/>
but
it failed. i can read the table meta information,but not the data.
here is my hive data:

```shell

0: jdbc:hive2://localhost:10000> create database testdb ;
No rows affected (2.048 seconds)
0: jdbc:hive2://localhost:10000> use testdb ;
No rows affected (0.106 seconds)
0: jdbc:hive2://localhost:10000> create table source (a bigint, b bigint) ;
No rows affected (1.026 seconds)
0: jdbc:hive2://localhost:10000> show tables ;
+-----------+--+
| tab_name  |
+-----------+--+
| source    |
+-----------+--+
1 row selected (0.877 seconds)
0: jdbc:hive2://localhost:10000> insert into source values (1, 1) ;
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available
in the future versions. Consider using a different execution engine
(i.e. tez, spark) or using Hive 1.X releases.
No rows affected (7.498 seconds)
0: jdbc:hive2://localhost:10000> select a, b from source ;
+----+----+--+
| a  | b  |
+----+----+--+
| 1  | 1  |
+----+----+--+

```

here is my flink sql client:

```shell

Flink SQL> show catalogs ;
+-----------------+
|    catalog name |
+-----------------+
| default_catalog |
|          myhive |
+-----------------+
2 rows in set

Flink SQL> use catalog myhive ;
[INFO] Execute statement succeed.

Flink SQL> show databases ;
+---------------+
| database name |
+---------------+
|       default |
|        testdb |
+---------------+
2 rows in set

Flink SQL> use testdb ;
[INFO] Execute statement succeed.

Flink SQL> show tables ;
+------------+
| table name |
+------------+
|     source |
+------------+
1 row in set

Flink SQL> SET sql-client.execution.result-mode=tableau;
[INFO] Session property has been set.

Flink SQL> select a, b from source ;
Empty set

```

I have added a new project to quickly reproduce this error:
https://github.com/lianxmfor/flink-hive

Reply via email to