ayushtkn commented on code in PR #4441:
URL: https://github.com/apache/hive/pull/4441#discussion_r1260105783
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/execute/AlterTableExecuteAnalyzer.java:
##########
@@ -89,8 +90,13 @@ protected void analyzeCommand(TableName tableName,
Map<String, String> partition
ZoneId timeZone = SessionState.get() == null ? new
HiveConf().getLocalTimeZone() : SessionState.get().getConf()
.getLocalTimeZone();
- TimestampTZ time =
TimestampTZUtil.parse(PlanUtils.stripQuotes(child.getText()), timeZone);
- spec = new AlterTableExecuteSpec(EXPIRE_SNAPSHOT, new
ExpireSnapshotsSpec(time.toEpochMilli()));
+ String childText = PlanUtils.stripQuotes(child.getText().trim());
+ if (childText.contains(",") || StringUtils.isNumeric(childText)) {
Review Comment:
done
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTableExecuteSpec.java:
##########
@@ -102,18 +104,34 @@ public String toString() {
* </ul>
*/
public static class ExpireSnapshotsSpec {
- private final long timestampMillis;
+ private long timestampMillis = -1L;
+ private String[] idsToExpire = null;
public ExpireSnapshotsSpec(long timestampMillis) {
this.timestampMillis = timestampMillis;
}
+ public ExpireSnapshotsSpec(String ids) {
+ this.idsToExpire = ids.split(",");
+ }
+
public Long getTimestampMillis() {
return timestampMillis;
}
+ public String[] getIdsToExpire() {
+ return idsToExpire;
+ }
+
+ public boolean isExpireByIds() {
+ return idsToExpire != null;
+ }
+
@Override
public String toString() {
+ if (isExpireByIds()) {
Review Comment:
done
--
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]