terrymanu commented on issue #29401:
URL: 
https://github.com/apache/shardingsphere/issues/29401#issuecomment-3638177443

   ##  Issue Understanding
   
     - In ShardingSphere-JDBC 5.3.2 (PostgreSQL, autoTables), running SELECT 
count(*) FROM push_message ... without schema leads to an NPE during result 
merging at schema.getTable(tableName).
   
   ##  Root Cause
   
     - For PostgreSQL, DatabaseTypeEngine.getDefaultSchemaName falls back to 
public. When SQL omits schema, metadata lookup goes to public. Current version 
only supports the public schema; your physical tables/metadata live in a custom 
schema (e.g., zzpush), so
       schema.getTable(tableName) returns null and triggers the NPE.
   
   ##  Analysis
   
     - SQL has no schema qualifier, so TablesContext can’t pick a schema and 
defaults to public.
     - PostgreSQL adapter currently loads metadata only from public; tables in 
custom schemas aren’t recognized, so merge phase can’t find table info and 
returns null.
     - Switching Standalone/ZooKeeper repositories or setting a dedicated H2 
jdbc_url only isolates metadata; it doesn’t bypass the “public-only” 
limitation, so the issue persists.
   
   ##  Conclusion
   
     - This is a current PostgreSQL limitation: only the public schema is 
supported, so custom-schema scenarios can’t be addressed right now. Please move 
the sharded tables to public or qualify SQL with public.push_message; if you 
must stay on a custom schema, you’ll need to wait for future support. Feel free 
to ask if you have further questions.


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