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

use openGauss: TableNotFoundException: Table or view 't_platform' does not exist #34706

Open
koradji2046 opened this issue Feb 18, 2025 · 0 comments

Comments

@koradji2046
Copy link

koradji2046 commented Feb 18, 2025

scenario description:

Java 8
Shared Domain JDBC 5.5.2
Spring boots 2.7.18

sharding.yaml

dataSources:
  db0:
    dataSourceClassName: com.alibaba.druid.pool.DruidDataSource

#    # this is ok
#    driverClassName: oracle.jdbc.driver.OracleDriver
#    url: jdbc:oracle:thin:@192.168.149.54:1521/orcl
#    username: qzkj_2ndc_dev
#    password: xxx
#    validation-query: select 1 from dual

#  # this is failed: TableNotFoundException: Table or view 't_tool_snowflake_generator' does not exist.
    driverClassName: org.opengauss.Driver
    url: jdbc:opengauss://192.168.149.113:5432/qzone_self_dev
    username: qzone_self_dev
    password: xxx
    validation-query: select 1

rules: 
- !SINGLE
  tables:
    - db0.t_sys_search_record
    - db0.t_platform
    - db0.t_sys_app
  defaultDataSource: db0

- !SHARDING
  tables:
    T_MESSAGE_INNER:
      actualDataNodes: db0.t_message_inner_202412,db0.t_message_inner_202501,db0.t_message_inner_202502
      tableStrategy:
        standard: 
          shardingColumn: createdate
          shardingAlgorithmName: table_inline
      keyGenerateStrategy:
        column: id
        keyGeneratorName: snowflake
  shardingAlgorithms:
    table_inline:
      type: INTERVAL
      props:
        datetime-pattern: 'yyyy-MM-dd HH:mm:ss'
        datetime-lower: '2024-12-01 08:00:00'
        datetime-interval-unit: MONTHS
        sharding-suffix-pattern: yyyyMM
        datatime-interval-amount: 1
  keyGenerators:
    snowflake:
      type: SNOWFLAKE
      props:
        workerId: 1
        dataCenterId: 1

The sharding.yaml above runs completely correctly, but replacing the database from Oracle to OpenGauss will throw an error:

TableNotFOundException: Table or view 't_platform' does not exist

After investigation, it was found that why was the metadata of public instead of qzone_stel_dev used for comparison? May I ask what settings are needed to solve this problem?

@koradji2046 koradji2046 changed the title use openGauss: TableNotFOundException: Table or view 't_platform' does not exist use openGauss: TableNotFoundException: Table or view 't_platform' does not exist Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant