Skip to content

Commit 0ddef8c

Browse files
committed
Merge origin/master into HIVE-29368
2 parents 75dbdf8 + 3d58586 commit 0ddef8c

File tree

139 files changed

+22399
-1422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+22399
-1422
lines changed

common/src/java/org/apache/hadoop/hive/conf/HiveConf.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,6 +3765,10 @@ public static enum ConfVars {
37653765
+ "prints) the same node multiple times. The number of visits can become exponential and make the server "
37663766
+ "crash or become unresponsive so this limit acts as a safety net to fail-fast the problematic query and "
37673767
+ "avoid bringing down the entire server."),
3768+
@InterfaceAudience.Private
3769+
HIVE_EXPLAIN_FORMATTED_INDENT("hive.explain.formatted.indent", false,
3770+
"Whether to indent the JSON output of EXPLAIN FORMATTED for better readability. " +
3771+
"The property is private to be used in tests only."),
37683772
// prefix used to auto generated column aliases (this should be started with '_')
37693773
HIVE_AUTOGEN_COLUMNALIAS_PREFIX_LABEL("hive.autogen.columnalias.prefix.label", "_c",
37703774
"String used as a prefix when auto generating column alias.\n" +
@@ -6551,6 +6555,19 @@ public HiveConf(Configuration other, Class<?> cls) {
65516555
initialize(cls);
65526556
}
65536557

6558+
/**
6559+
* For internal use only, assumed the "other" has loaded all properties that intend to use
6560+
* and want to cast it to a HiveConf without extra re-loading the source file.
6561+
* @param other The Configuration whose properties are to be wrapped by this HiveConf.
6562+
*/
6563+
private HiveConf(Configuration other) {
6564+
super(other);
6565+
setupRestrictList();
6566+
hiddenSet.addAll(HiveConfUtil.getHiddenSet(other));
6567+
lockedSet.addAll(HiveConfUtil.getLockedSet(other));
6568+
origProp = getProperties(other);
6569+
}
6570+
65546571
/**
65556572
* Copy constructor
65566573
*/
@@ -7313,4 +7330,19 @@ public void syncFromConf(HiveConf conf) {
73137330
set(e.getKey(), e.getValue());
73147331
}
73157332
}
7333+
7334+
/**
7335+
* Sometimes if the configuration contains all the information we want,
7336+
* but want to cast it to a HiveConf, without loading the props from the
7337+
* source file again, which is wasteful and might cost dozens of milliseconds.
7338+
* @param configuration The original configuration
7339+
* @return A HiveConf wrapping on the original configuration
7340+
*/
7341+
public static HiveConf cloneConf(Configuration configuration) {
7342+
if (configuration instanceof HiveConf config) {
7343+
return new HiveConf(config);
7344+
} else {
7345+
return new HiveConf(configuration);
7346+
}
7347+
}
73167348
}

common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public enum ErrorMsg {
468468
RESOURCE_PLAN_ALREADY_EXISTS(10417, "Resource plan {0} already exists", true),
469469
RESOURCE_PLAN_NOT_EXISTS(10418, "Resource plan {0} does not exist", true),
470470
INCOMPATIBLE_STRUCT(10419, "Incompatible structs.", true),
471-
OBJECTNAME_CONTAINS_DOT(10420, "Table or database name may not contain dot(.) character", true),
471+
OBJECTNAME_CONTAINS_DOT(10420, "Catalog, database or table names may not contain dot(.) character", true),
472472
WITHIN_GROUP_NOT_ALLOWED(10421,
473473
"Not an ordered-set aggregate function: {0}. WITHIN GROUP clause is not allowed.", true),
474474
WITHIN_GROUP_PARAMETER_MISMATCH(10422,

data/conf/iceberg/tez/hive-site.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,8 @@
320320
<name>hive.lock.sleep.between.retries</name>
321321
<value>2</value>
322322
</property>
323+
<property>
324+
<name>hive.explain.formatted.indent</name>
325+
<value>true</value>
326+
</property>
323327
</configuration>

data/conf/llap/hive-site.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@
294294
<name>hive.explain.user</name>
295295
<value>false</value>
296296
</property>
297-
297+
<property>
298+
<name>hive.explain.formatted.indent</name>
299+
<value>true</value>
300+
</property>
298301
<property>
299302
<name>hive.join.inner.residual</name>
300303
<value>true</value>

iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/HiveTableTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,17 @@
3838
import org.apache.hadoop.hive.serde.serdeConstants;
3939
import org.apache.hive.iceberg.org.apache.avro.generic.GenericData;
4040
import org.apache.hive.iceberg.org.apache.avro.generic.GenericRecordBuilder;
41-
import org.apache.iceberg.BaseTable;
4241
import org.apache.iceberg.DataFile;
4342
import org.apache.iceberg.DataFiles;
4443
import org.apache.iceberg.FileScanTask;
4544
import org.apache.iceberg.Files;
46-
import org.apache.iceberg.HasTableOperations;
4745
import org.apache.iceberg.ManifestFile;
4846
import org.apache.iceberg.PartitionSpec;
4947
import org.apache.iceberg.Schema;
5048
import org.apache.iceberg.Table;
5149
import org.apache.iceberg.TableMetadataParser;
5250
import org.apache.iceberg.TableProperties;
51+
import org.apache.iceberg.TableUtil;
5352
import org.apache.iceberg.avro.Avro;
5453
import org.apache.iceberg.avro.AvroSchemaUtil;
5554
import org.apache.iceberg.catalog.Namespace;
@@ -259,7 +258,7 @@ public void testDropTable() throws IOException {
259258
.as("Table manifest files should not exist")
260259
.doesNotExist();
261260
}
262-
assertThat(new File(((HasTableOperations) table).operations().current().metadataFileLocation()
261+
assertThat(new File(TableUtil.metadataFileLocation(table)
263262
.replace("file:", "")))
264263
.as("Table metadata file should not exist")
265264
.doesNotExist();
@@ -552,7 +551,7 @@ public void testRegisterHadoopTableToHiveCatalog() throws IOException, TExceptio
552551
.hasMessage("Table does not exist: hivedb.table1");
553552

554553
// register the table to hive catalog using the latest metadata file
555-
String latestMetadataFile = ((BaseTable) table).operations().current().metadataFileLocation();
554+
String latestMetadataFile = TableUtil.metadataFileLocation(table);
556555
catalog.registerTable(identifier, "file:" + latestMetadataFile);
557556
assertThat(HIVE_METASTORE_EXTENSION.metastoreClient().getTable(DB_NAME, "table1")).isNotNull();
558557

0 commit comments

Comments
 (0)