Skip to content

HIVE-21679: Replicating a CTAS event creating an MM table fails.#617

Closed
sankarh wants to merge 2 commits intoapache:masterfrom
sankarh:HIVE-21679
Closed

HIVE-21679: Replicating a CTAS event creating an MM table fails.#617
sankarh wants to merge 2 commits intoapache:masterfrom
sankarh:HIVE-21679

Conversation

@sankarh
Copy link
Contributor

@sankarh sankarh commented May 6, 2019

No description provided.

// write id.
if ((dbName == null) || tableName.contains(".")) {
String[] names = Utilities.getDbTableName(tableName);
dbName = names[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if table name does not contain '.' ..this may throw array out of bound exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If dbName is null, then we expect to have db.table in tableName. CreateTableDesc.toTable for reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be I will remove the dbname null check.

throw new SemanticException("db name can not be null");
}
if (dbName.contains(".") || ((tableName != null) && tableName.contains("."))) {
throw new SemanticException("Invalid DB or table name." + dbName + "::"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"::" can be printed if table name is not null

Copy link
Contributor Author

@sankarh sankarh May 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Having :: helps to find if DB is empty or table name is null/empty easily. No change.


// Create a non-acid table and replicate it.
WarehouseInstance.Tuple bootStrapDump = primary.run("use " + primaryDbName)
.run("create table t1_nonacid (a int, b int)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this test case is already there in test replication acid table incremental load ..just need to change the table property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it is better to have new test case here instead of editing incremental acid test suit which is already heavy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, updating current test case and removing new one.

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

Successfully merging this pull request may close these issues.

2 participants