saihemanth-cloudera commented on code in PR #3627:
URL: https://github.com/apache/hive/pull/3627#discussion_r982764300
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/create/like/CreateTableLikeOperation.java:
##########
@@ -157,27 +158,12 @@ private void setTableParameters(Table tbl) throws
HiveException {
}
// We should copy only those table parameters that are specified in the
config.
SerDeSpec spec = AnnotationUtils.getAnnotation(serdeClass,
SerDeSpec.class);
-
- // for non-native table, property storage_handler should be retained
- retainer.add(META_TABLE_STORAGE);
- if (spec != null && spec.schemaProps() != null) {
- retainer.addAll(Arrays.asList(spec.schemaProps()));
- }
-
- String paramsStr = HiveConf.getVar(context.getConf(),
HiveConf.ConfVars.DDL_CTL_PARAMETERS_WHITELIST);
- if (paramsStr != null) {
- retainer.addAll(Arrays.asList(paramsStr.split(",")));
- }
-
- Map<String, String> params = tbl.getParameters();
- if (!retainer.isEmpty()) {
- params.keySet().retainAll(retainer);
- } else {
- params.clear();
- }
+ //With Hive-25813, we'll not copy over table properties from the source.
+ //CTLT should should copy column schema but not table properties. It is
also consistent with other query engines like mysql, redshift.
+ tbl.getParameters().clear();
Review Comment:
Yeah, that is true. Going forward we don't want to copy over the physical
properties like table parameters in CTLT command. This implementation is inline
with other SQL engines like Mysql, Redshift e.t.c.
Given that user can still have same tbl properties as that of source table
by explicitly specifiying the TBL PROPERTIES(). Eg:
https://github.com/apache/hive/pull/3627/files#diff-fac39ae652bb8a3e42e189a4efec47b5184ebbb4b7db52ce489dfc343844fd91R11
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]