Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ public String toString() {
ConfVars.METASTORE_PARTITIONS_PARAMETERS_EXCLUDE_PATTERN,
// Add metaConfVars here as well
ConfVars.TRY_DIRECT_SQL,
ConfVars.TRY_DIRECT_SQL_DDL,
ConfVars.CLIENT_SOCKET_TIMEOUT,
ConfVars.PARTITION_NAME_WHITELIST_PATTERN,
ConfVars.PARTITION_ORDER_EXPR,
Expand All @@ -264,7 +263,6 @@ public String toString() {
*/
public static final MetastoreConf.ConfVars[] metaConfVars = {
ConfVars.TRY_DIRECT_SQL,
ConfVars.TRY_DIRECT_SQL_DDL,
ConfVars.CLIENT_SOCKET_TIMEOUT,
ConfVars.PARTITION_NAME_WHITELIST_PATTERN,
ConfVars.PARTITION_ORDER_EXPR,
Expand Down Expand Up @@ -1663,12 +1661,6 @@ public enum ConfVars {
"work for all queries on your datastore. If all SQL queries fail (for example, your\n" +
"metastore is backed by MongoDB), you might want to disable this to save the\n" +
"try-and-fall-back cost."),
TRY_DIRECT_SQL_DDL("metastore.try.direct.sql.ddl", "hive.metastore.try.direct.sql.ddl", true,
"Same as hive.metastore.try.direct.sql, for read statements within a transaction that\n" +
"modifies metastore data. Due to non-standard behavior in Postgres, if a direct SQL\n" +
"select query has incorrect syntax or something similar inside a transaction, the\n" +
"entire transaction will fail and fall-back to DataNucleus will not be possible. You\n" +
"should disable the usage of direct SQL inside transactions if that happens in your case."),
TXN_MAX_OPEN_BATCH("metastore.txn.max.open.batch", "hive.txn.max.open.batch", 1000,
"Maximum number of transactions that can be fetched in one call to open_txns().\n" +
"This controls how many transactions streaming agents such as Flume or Storm open\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4174,11 +4174,7 @@ public GetHelper(String catalogName, String dbName, String tblName,
this.doTrace = LOG.isDebugEnabled();
this.isInTxn = isActiveTransaction();

// SQL usage inside a larger transaction (e.g. droptable) may not be desirable because
// some databases (e.g. Postgres) abort the entire transaction when any query fails, so
// the fallback from failed SQL to JDO is not possible.
boolean isConfigEnabled = MetastoreConf.getBoolVar(getConf(), ConfVars.TRY_DIRECT_SQL)
&& (MetastoreConf.getBoolVar(getConf(), ConfVars.TRY_DIRECT_SQL_DDL) || !isInTxn);
boolean isConfigEnabled = MetastoreConf.getBoolVar(getConf(), ConfVars.TRY_DIRECT_SQL);
if (isConfigEnabled && directSql == null) {
directSql = new MetaStoreDirectSql(pm, getConf(), "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void setup() throws TException {
tbl = client.getTable(dbName, tblName);
// set directSQL to true explicitly
client.setMetaConf(ConfVars.TRY_DIRECT_SQL.getVarname(), "true");
client.setMetaConf(ConfVars.TRY_DIRECT_SQL_DDL.getVarname(), "true");
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public static void startMetaStoreServer() throws Exception {
Configuration metastoreConf = MetastoreConf.newMetastoreConf();
MetastoreConf.setClass(metastoreConf, ConfVars.EXPRESSION_PROXY_CLASS,
MockPartitionExpressionForMetastore.class, PartitionExpressionProxy.class);
MetastoreConf.setBoolVar(metastoreConf, ConfVars.TRY_DIRECT_SQL_DDL, false);
MetaStoreTestUtils.setConfForStandloneMode(metastoreConf);
int msPort = MetaStoreServerUtils.startMetaStore(metastoreConf);
conf = MetastoreConf.newMetastoreConf();
Expand Down Expand Up @@ -97,14 +96,6 @@ public void testGetMetaConfDefaultEmptyString() throws TException {
assertEquals(expected, actual);
}

@Test
public void testGetMetaConfOverridden() throws TException {
ConfVars metaConfVar = ConfVars.TRY_DIRECT_SQL_DDL;
String expected = "false";
String actual = hmsc.getMetaConf(metaConfVar.toString());
assertEquals(expected, actual);
}

@Test
public void testGetMetaConfUnknownPreperty() throws TException {
String unknownPropertyName = "hive.meta.foo.bar";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,6 @@ public void testAlterTableAlreadyExists() throws Exception {
@Test
public void testAlterTableExpectedPropertyMatch() throws Exception {
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL));
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL_DDL));
Table originalTable = testTables[0];

EnvironmentContext context = new EnvironmentContext();
Expand All @@ -1213,7 +1212,6 @@ public void testAlterTableExpectedPropertyMatch() throws Exception {
@Test(expected = MetaException.class)
public void testAlterTableExpectedPropertyDifferent() throws Exception {
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL));
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL_DDL));
Table originalTable = testTables[0];

EnvironmentContext context = new EnvironmentContext();
Expand All @@ -1234,7 +1232,6 @@ public void testAlterTableExpectedPropertyDifferent() throws Exception {
@Test
public void testAlterTableExpectedPropertyConcurrent() throws Exception {
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL));
Assume.assumeTrue(MetastoreConf.getBoolVar(metaStore.getConf(), ConfVars.TRY_DIRECT_SQL_DDL));
Table originalTable = testTables[0];

originalTable.getParameters().put("snapshot", "0");
Expand Down