alexalves83 opened a new issue, #39196:
URL: https://github.com/apache/shardingsphere/issues/39196

   #Doris DDL compatibility issue in ShardingSphere Proxy 5.5.3
   
   #Environment
   ShardingSphere Proxy: 5.5.3
   Backend database: Apache Doris
   JDBC Driver: mysql-connector-j-9.4.0
   
   #The proxy image contains Doris modules:
   shardingsphere-database-connector-doris-5.5.3.jar
   shardingsphere-parser-sql-engine-doris-5.5.3.jar
   shardingsphere-parser-sql-statement-doris-5.5.3.jar
   shardingsphere-proxy-dialect-doris-5.5.3.jar
   
   #Summary
   I successfully configured ShardingSphere Proxy 5.5.3 as a MySQL proxy in 
front of Apache Doris.
   The following operations work correctly:
   
   SHOW DATABASES;SHOW TABLES;DESCRIBE table_name;SHOW CREATE TABLE 
table_name;SELECT ...;INSERT ...;DELETE ...;
   The SQL is routed correctly to Doris.
   
   Example from the logs:
   Actual SQL: doris ::: SELECT * FROM TESTE_MEDIUMShow more lines
   Actual SQL: doris ::: INSERT INTO TESTE_MEDIUMVALUES (1000,'ALTERADO')Show 
more lines
   Actual SQL: doris ::: DELETEFROM TESTE_MEDIUMWHERE ID = 1000Show more lines
   
   Problem
   DDL statements containing Doris-specific syntax are rejected by the 
ShardingSphere parser before reaching the backend.
   
   Reproduction
   This statement is accepted and forwarded to Doris:
   SQLCREATE TABLE benchmark.TESTE1 (    ID_CONTRIBUINTE INT);
   
   Log:
   Actual SQL: doris ::: CREATE TABLE TESTE1 (    ID_CONTRIBUINTE INT)
   
   Doris responds:
   errCode = 2, detailMessage = replication num should be less than the number 
of available backends.
   This confirms that the statement reaches Doris.
   
   However, the following Doris DDL does not work:
   SQLCREATE TABLE benchmark.TESTE1 (    ID_CONTRIBUINTE INT)PROPERTIES (    
"replication_num" = "1");
   
   Error:
   Plain TextERROR 1064 (42000): You have an error in your SQL syntax:no viable 
alternative at input 'PROPERTIES'
   
   Stack trace:
   
Textorg.apache.shardingsphere.database.exception.core.exception.syntax.sql.DialectSQLParsingExceptionorg.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(...)
   The statement is rejected during parsing and is never sent to Doris.
   
   Another example:
   CREATE TABLE benchmark.IFTD_CONTRIBUINTE (    ID_CONTRIBUINTE INT)DUPLICATE 
KEY(ID_CONTRIBUINTE)DISTRIBUTED BY HASH(ID_CONTRIBUINTE) BUCKETS 1PROPERTIES (  
  "replication_num" = "1");
   
   Error:
   ERROR 1064 (42000): You have an error in your SQL syntax:no viable 
alternative at input 'DUPLICATE'
   Additional Observation
   The parser also rejects:
   
   Example:
   SQLCREATE TABLE TEST (    ID MEDIUMINT);
   Result:
   no viable alternative at input 'MEDIUMINT'
   
   #Expected Behavior
   Since ShardingSphere Proxy 5.5.3 includes Doris-specific modules:
   Plain 
Textshardingsphere-database-connector-dorisshardingsphere-parser-sql-engine-dorisshardingsphere-parser-sql-statement-dorisshardingsphere-proxy-dialect-dorisShow
 more lines
   and the release notes mention improved Doris SQL compatibility, I expected 
Doris DDL syntax such as:
   SQLDUPLICATE KEYDISTRIBUTED BY HASHPROPERTIESMEDIUMINTShow more lines
   to be accepted and forwarded to the Doris backend.
   
   #Actual Behavior
   The Doris-specific DDL syntax is rejected by the parser:
   Plain TextDialectSQLParsingExceptionShow more lines
   before reaching the backend database.
   Can you confirm whether this is:
   
   A bug in the Doris parser implementation?
   A missing configuration?
   A currently unsupported subset of Doris DDL syntax?
   
   Thank you.


-- 
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.

To unsubscribe, e-mail: 
[email protected]

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

Reply via email to