noroadzh commented on issue #30551: URL: https://github.com/apache/shardingsphere/issues/30551#issuecomment-2010097326
> - I saw the problem with the unit test you wrote at https://github.com/linghengqian/sharding5/commit/c4366f5973894762e865af8e5ce95a3581f72b6a . > > 1. You should not use snakeyaml 2.2, but should follow shardingsphere 5.4.1 and use snakeyaml 1.33. For using snakeyaml 2.2, this is on the milestone of shardingsphere 5.5.0. Reference #28805. > 2. There is a problem with the shardingsphere configuration file you wrote. There are no properties for `dataSources.names` and `rules[0].sharding-algorithms`, and shardingsphere has never declared that `sharding-algorithms` is equivalent to `shardingAlgorithms`. > 3. You are not using maven wrapper. I have no way of knowing the maven version you are using. I can only initialize the wrapper environment on site. > 4. You don’t seem to realize that shardingsphere’s compatibility with h2database is only based on the `mysql` mode of h2database, and shardingsphere does not test the `oracle` mode of h2database. I think if you need to test for oracle database, you need to write unit tests using `testcontainers-java`. Refer to https://github.com/apache/shardingsphere/tree/a09574b0b0fa03ce58a838a376bf5a75d346d122/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases . > 5. `shardingsphere-jdbc-core` is not a pom, it is a jar. > > - Overall, there is a problem with the SQL you wrote. Either rewrite your SQL to mysql mode compatible SQL, or use testcontainers-java to create a docker instance of oracle database. > > ```shell > Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "\000a\000aCREATE TABLE `data_interface_status_202402`\000a(\000a `id` VARCHAR(64) PRIMARY KEY,\000a `ADDUP_CYCLE` BIGINT[*](20),\000a `TOTAL_COUNT` BIGINT(20),\000a `SUCCESS_QUANTITY` BIGINT(20),\000a `ACCESS_SERVICE_NAME` VARCHAR(255),\000a `SERVICE_STATUS` VARCHAR(20) ,\000a `SERVICE_STATUS_DESCRIPTION` VARCHAR(4000)\000a)"; expected "ARRAY, INVISIBLE, VISIBLE, NOT NULL, NULL, AS, DEFAULT, GENERATED, ON UPDATE, NOT NULL, NULL, AUTO_INCREMENT, DEFAULT ON NULL, NULL_TO_DEFAULT, SEQUENCE, SELECTIVITY, COMMENT, CONSTRAINT, COMMENT, PRIMARY KEY, UNIQUE, NOT NULL, NULL, CHECK, REFERENCES, AUTO_INCREMENT, ,, )"; SQL statement: > > > CREATE TABLE `data_interface_status_202402` > ( > `id` VARCHAR(64) PRIMARY KEY, > `ADDUP_CYCLE` BIGINT(20), > `TOTAL_COUNT` BIGINT(20), > `SUCCESS_QUANTITY` BIGINT(20), > `ACCESS_SERVICE_NAME` VARCHAR(255), > `SERVICE_STATUS` VARCHAR(20) , > `SERVICE_STATUS_DESCRIPTION` VARCHAR(4000) > ) [42001-214] > ``` Thanks for replying at this point in time, I realized that you've said a lot of things about my test project, I'll make the adjustments you've mentioned and try - [ ] again when I'm done! -- 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]
