Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6405 Disallow bulk loading into non-empty tables with global … - #1265
Conversation
| // There must be a better solution for this | ||
| String tn = sName == null ? "\"" + tName + "\"" : "\"" + sName + "\".\"" + tName + "\""; | ||
| ResultSet rsempty = conn.createStatement().executeQuery("SELECT * FROM " + tn); |
There was a problem hiding this comment.
Add limit 1 to hopefully reduce the load.
There was a problem hiding this comment.
Also I'm sure we already have a utility function somewhere to generate the table name from the components.
| List<TargetTableRef> tablesToBeLoaded = new ArrayList<TargetTableRef>(); | ||
| PTable table = PhoenixRuntime.getTable(conn, qualifiedTableName); | ||
| boolean isImmutable = table.isImmutableRows(); |
There was a problem hiding this comment.
I think that bulk loading does not observe immutability, and you can modify rows with it.
If that's true, then we shouldn't treat immuable tables any different than normal ones.
Could you please check this ?
stoty
commented
Jul 15, 2021
💔 -1 overall
This message was automatically generated. |
| String sName = SchemaUtil.normalizeIdentifier(schemaName); | ||
| String tName = SchemaUtil.normalizeIdentifier(tableName); | ||
| // There must be a better solution for this |
There was a problem hiding this comment.
nit:
I don't think there really is.
We could query the table via HBase API directly, but that wouldn't really help.
| } | ||
| if(hasGlobalIndexes && tableNotEmpty && !cmdLine.hasOption(ENABLE_CORRUPT_INDEXES.getOpt())){ | ||
| throw new IllegalStateException("Bulk Loader error: Bulk loading is disabled for" + |
There was a problem hiding this comment.
A bit more context may help:
Bulk Loading error: Bulk loading is disabled for non empty tables with global indexes, because it will corrupt the global index table in most cases.
Use the --corruptindexes option to override this check.
…secondary indexes Change-Id: I55e2f6138f69add7ffa028baab6d8ea80681acf0
stoty
commented
Jul 15, 2021
💔 -1 overall
This message was automatically generated. |
…secondary indexes