The root cause of this problem is the current username is used as the default schema name and \sqldump was not able to find any schema objects associated with that schema name; hence nothing generated except header (you can verify this by executing \sqldump as 'sqldump -s schema_name', e.g. 'sqldump -s public').
I reviewed ADS code, there are 2 problems:
(1) The first nCluster version that ADS started to support is nCluster 3.0 which does not support schema. I currently have access to the following nCluster documents: versions 3.0, 4.5, 4.6 and 5.0. nCluser 4.5, 4.6 and 5.0 do support schema, but ADS implementation only supports schema if nCluster version is 4.6 or newer, don't know why; and, do not know whether 4.5 is the first version that supports schema.
(2) ConnectionProperties.getCurrentSchema() returns username as the current schema for nCluster (the root cause of this issue). I reviewed nCluster document, it seems that the only way to get current schema from nCluster is to execute 'SHOW search_path' and parse its result. Unlike PostgreSQL, Greenplum, etc, nCluster does not support 'SELECT current_schema()'. Not sure whether we want to use 'SHOW search_path' to get the current schema for nCluster.
I need to discuss (1) and (2) above with Niels before making any changes.
Discussed (1) and (2) with Niels:
For (1), current ADS implementation always takes schema into consideration; hence, nCluster versions that do not support schema (e.g. nCluster 3.0) are no longer supported by ADS.
For (2), not sure if 'SHOW search_path' is the correct way to get the current schema; we will discuss this with Sachin on Monday.
Discussed (1) and (2) with Niels:
For (1), current ADS implementation always takes schema into consideration; hence, nCluster versions that do not support schema (e.g. nCluster 3.0) are no longer supported by ADS.
For (2), not sure if 'SHOW search_path' is the correct way to get the current schema; we will discuss this with Sachin on Monday.
For (1), current ADS implementation always takes schema into consideration; hence, nCluster versions that do not support schema (e.g. nCluster 3.0) are no longer supported by ADS.
@funfun: QA is testing with nCluster 5.0 and saying sqldump is failing.
For (1), current ADS implementation always takes schema into consideration; hence, nCluster versions that do not support schema (e.g. nCluster 3.0) are no longer supported by ADS.
@funfun: QA is testing with nCluster 5.0 and saying sqldump is failing.
> QA is testing with nCluster 5.0 and saying sqldump is failing.
Fluid commands such as \sqldump, \sqlimport, \sqlexport, etc. take a "-s (or --schema) SCHEMA_NAME" option to locate the database object(s) from the server. If -s option is not specified, these commands will consult ConnectionProperties.getCurrentSchema( ) to get the current schema as the default schema name. The root cause of this issue is ConnectionProperties.getCurrentSchema( ) returns the login username as the current schema name for nCluster, and, the login username is not a real schema name and hence no database objects are retrieved from the server. For the time being, the only way to get \sqldump work for nCluster is to run \sqldump with -s option or -S (capital S for all schemas) specified: for example - '\sqldump -s public' or '\sqldump -S' (capital S for all schemas). This scenario applies to all of fluid commands that take -s/--schema option, e.g. \sqlexport, \sqlimport.
> QA is testing with nCluster 5.0 and saying sqldump is failing.
Fluid commands such as \sqldump, \sqlimport, \sqlexport, etc. take a "-s (or --schema) SCHEMA_NAME" option to locate the database object(s) from the server. If -s option is not specified, these commands will consult ConnectionProperties.getCurrentSchema( ) to get the current schema as the default schema name. The root cause of this issue is ConnectionProperties.getCurrentSchema( ) returns the login username as the current schema name for nCluster, and, the login username is not a real schema name and hence no database objects are retrieved from the server. For the time being, the only way to get \sqldump work for nCluster is to run \sqldump with -s option or -S (capital S for all schemas) specified: for example - '\sqldump -s public' or '\sqldump -S' (capital S for all schemas). This scenario applies to all of fluid commands that take -s/--schema option, e.g. \sqlexport, \sqlimport.
BTW, executing 'SHOW search_path' using trunk/15.0.0-dev-7/ADS returns nothing, and one row is returned using 14.0.0-beta-86/ADS; server is nCluster 5.0 running on xxx.xxx.2.11. Perhaps bundled ncluster jar files make the difference, not sure.
BTW, executing 'SHOW search_path' using trunk/15.0.0-dev-7/ADS returns nothing, and one row is returned using 14.0.0-beta-86/ADS; server is nCluster 5.0 running on xxx.xxx.2.11. Perhaps bundled ncluster jar files make the difference, not sure.
Ivan was working on a related issue wrt how to get current schema for nCluster. We decided to use SHOW search_path as nCluster does not provide a current_schema() variable. Please go ahead and use this for sqldump as well.
Regarding the difference in behavior in v14 & trunk, the reason is due to the JDBC. we've checked in v4 of the nCluster JDBC driver in v14 b/c v5 is too buggy. By the time we release v15, we'll either have an updated v5 or revert back to v4 of the nCluster JDBC driver.
Ivan was working on a related issue wrt how to get current schema for nCluster. We decided to use SHOW search_path as nCluster does not provide a current_schema() variable. Please go ahead and use this for sqldump as well.
Regarding the difference in behavior in v14 & trunk, the reason is due to the JDBC. we've checked in v4 of the nCluster JDBC driver in v14 b/c v5 is too buggy. By the time we release v15, we'll either have an updated v5 or revert back to v4 of the nCluster JDBC driver.
Abhishek, please test all combinations og \sqldump, \sqlimport, \sqlexport and mark it as verified. I verified sqldump and now it correctly displaysfor nCluster in 14.0.0-rc-2.
Abhishek, please test all combinations og \sqldump, \sqlimport, \sqlexport and mark it as verified. I verified sqldump and now it correctly displaysfor nCluster in 14.0.0-rc-2.
Issue #9792 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 14.0.0-rc-2 |
No time estimate |
1 issue link |
relates to #9728
Issue #9728There is no Schema name as " beehive" under database but Query Analyzer window shows Schema name as "beehive" |
The root cause of this problem is the current username is used as the default schema name and \sqldump was not able to find any schema objects associated with that schema name; hence nothing generated except header (you can verify this by executing \sqldump as 'sqldump -s schema_name', e.g. 'sqldump -s public').
I reviewed ADS code, there are 2 problems:
(1) The first nCluster version that ADS started to support is nCluster 3.0 which does not support schema. I currently have access to the following nCluster documents: versions 3.0, 4.5, 4.6 and 5.0. nCluser 4.5, 4.6 and 5.0 do support schema, but ADS implementation only supports schema if nCluster version is 4.6 or newer, don't know why; and, do not know whether 4.5 is the first version that supports schema.
(2) ConnectionProperties.getCurrentSchema() returns username as the current schema for nCluster (the root cause of this issue). I reviewed nCluster document, it seems that the only way to get current schema from nCluster is to execute 'SHOW search_path' and parse its result. Unlike PostgreSQL, Greenplum, etc, nCluster does not support 'SELECT current_schema()'. Not sure whether we want to use 'SHOW search_path' to get the current schema for nCluster.
I need to discuss (1) and (2) above with Niels before making any changes.