Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]SQL Create external table table_like like table error #8780

Closed
adzfolc opened this issue Jul 15, 2022 · 0 comments · Fixed by #8781 or #8804
Closed

[Bug]SQL Create external table table_like like table error #8780

adzfolc opened this issue Jul 15, 2022 · 0 comments · Fixed by #8781 or #8804
Labels
type/bug Something isn't working

Comments

@adzfolc
Copy link
Contributor

adzfolc commented Jul 15, 2022

Steps to reproduce the behavior (Required)

  1. CREATE EXTERNAL TABLE test_part_table(
    word string,
    num bigint,
    dt string)
    ENGINE=HIVE
    PROPERTIES (
    "database" = "old_test",
    "table" = "test_part_table",
    "resource" = "old_hive",
    "hive.metastore.uris" = "thrift://127.0.0.1:29083");
  2. create external table test_part_table_like like test_part_table;

Expected behavior (Required)

mysql> CREATE EXTERNAL TABLE `test_part_table`(
    ->   `word` string, 
    ->   `num` bigint,
    ->   `dt` string)
    -> ENGINE=HIVE
    -> PROPERTIES (
    -> "database" = "old_test",
    -> "table" = "test_part_table",
    -> "resource" = "old_hive",
    -> "hive.metastore.uris" = "thrift://127.0.0.1:29083");
Query OK, 0 rows affected (0.82 sec)

mysql> create external table test_part_table_like like test_part_table;
Query OK, 0 rows affected (0.03 sec)

mysql> show tables;
+----------------------+
| Tables_in_demodb     |
+----------------------+
| test_part_table      |
| test_part_table_like |
+----------------------+
2 rows in set (0.00 sec)

mysql> select * from test_part_table;
+----------+------+------+
| word     | num  | dt   |
+----------+------+------+
| old_test |    6 | 6-17 |
| old_test |    3 | 6-13 |
| old_test |    4 | 6-15 |
| old_test |    1 | 6-11 |
| old_test |    2 | 6-13 |
| old_test |    5 | 6-16 |
+----------+------+------+
6 rows in set (2.57 sec)

mysql> select * from test_part_table_like;
+----------+------+------+
| word     | num  | dt   |
+----------+------+------+
| old_test |    3 | 6-13 |
| old_test |    5 | 6-16 |
| old_test |    6 | 6-17 |
| old_test |    2 | 6-13 |
| old_test |    4 | 6-15 |
| old_test |    1 | 6-11 |
+----------+------+------+
6 rows in set (0.03 sec)

Real behavior (Required)

create external table hive_crt_like_1 like ex_hive_tbl;
execute sql error and messages: (1064, 'Syntax error in line 1:\ncreate external table hive_crt_like_1 like ex_hive_tbl\n ^\nEncountered: LIKE\nExpected\n'), and time is: 2022-07-15 01:56:53

StarRocks version (Required)

  • You can get the StarRocks version by executing SQL select current_version()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
1 participant