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

CREATE TABLE statement with PARTITION clause raise an error when logic table doesn't exists #983

Closed
tankilo opened this issue Feb 12, 2019 · 4 comments
Labels
community issue from community

Comments

@tankilo
Copy link
Contributor

tankilo commented Feb 12, 2019

https://actiontech.github.io/dble-docs-cn/3.SQL_Syntax/3.1_DDL/3.1.1_DDL&Table_Syntax.html 看到ddl语法

mysql> create table customer_test(customer_id int (11),name varchar (60),province varchar (60),age Decimal (21),register_date date) PARTITION by hash(customer_id) PARTITIONS 4;
ERROR 1146 (42S02): Table 'testdb.customer_test' doesn't exist in the config of schema

应该DDL去schema和物理分库增加这个表的,但是现在反而报没有。

@sunsun314
Copy link
Contributor

check your schema.xml config file & read the config doc with patient
I guess the problem is you did not define this table in config file

@tankilo
Copy link
Contributor Author

tankilo commented Feb 12, 2019

check your schema.xml config file & read the config doc with patient
I guess the problem is you did not define this table in config file

Thanks for your reply. But what I mean to say is that if i use CREATE TABLE statement with PARTITION clause, obviously I know there are no related table tags in schema.xml and I want dble to create logic table and releated physical tables for me, such like creating table tag in schemal.xml with the information i provide in the CREATE TABLE sql, etc.

The current logic of the code is only suitable for CREATE TABLE statement without PARTITION clause, which means logic table exists but there are no physical tables on partions . In this situation, DBLE will route the sql to all the partions of that logic table.

@tankilo tankilo changed the title dble执行DDL建表的时候报错 CREATE TABLE statement with PARTITION clause raise an error when logic table doesn't exists Feb 12, 2019
@sunsun314
Copy link
Contributor

Well,DDL doc may be little confusing.
The PARTITION in create table syntax means you can create physical tables with PARTITION optimization.
This feature is the solution of the request "Split table in single dataNode"(Which referred to by users many times in the community) .
And the feature you mention may be implement in the future(obviously in other way).
We would not implement this functionality using standard SQL syntax to avoid misunderstanding in use.

@tankilo
Copy link
Contributor Author

tankilo commented Feb 13, 2019

Understood! Thanks~

@tankilo tankilo closed this as completed Feb 13, 2019
@yanhuqing666 yanhuqing666 added the community issue from community label Feb 13, 2019
@tankilo tankilo mentioned this issue Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community issue from community
Projects
None yet
Development

No branches or pull requests

3 participants