deniskuzZ commented on code in PR #5370:
URL: https://github.com/apache/hive/pull/5370#discussion_r1728798009
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/lineage/Generator.java:
##########
@@ -67,59 +63,59 @@
public class Generator extends Transform {
private static final Logger LOG = LoggerFactory.getLogger(Generator.class);
- private static final String ALL = "ALL";
- private static final String NONE = "NONE";
- private static final Map<HiveOperation, Function<ParseContext, Boolean>>
filterMap;
private final Predicate<ParseContext> statementFilter;
- static {
- Map<HiveOperation, Function<ParseContext, Boolean>> map = new
EnumMap<>(HiveOperation.class);
- map.put(HiveOperation.CREATETABLE, parseContext ->
parseContext.getCreateTable() != null);
- map.put(HiveOperation.CREATETABLE_AS_SELECT, parseContext ->
parseContext.getQueryProperties().isCTAS());
- map.put(HiveOperation.CREATEVIEW, parseContext ->
parseContext.getQueryProperties().isView());
- map.put(HiveOperation.CREATE_MATERIALIZED_VIEW,
- parseContext ->
parseContext.getQueryProperties().isMaterializedView());
- map.put(HiveOperation.LOAD,
- parseContext -> !(parseContext.getLoadTableWork() == null ||
parseContext.getLoadTableWork().isEmpty()));
- map.put(HiveOperation.QUERY, parseContext ->
parseContext.getQueryProperties().isQuery());
- filterMap = Collections.unmodifiableMap(map);
+ enum LineageInfoFilter {
+ CREATE_TABLE(parseContext -> parseContext.getCreateTable() != null),
+ CREATE_TABLE_AS_SELECT(parseContext ->
parseContext.getQueryProperties().isCTAS()),
+ CREATE_VIEW(parseContext -> parseContext.getQueryProperties().isView()),
+ CREATE_MATERIALIZED_VIEW(parseContext ->
parseContext.getQueryProperties().isMaterializedView()),
+ LOAD(parseContext -> !(parseContext.getLoadTableWork() == null ||
parseContext.getLoadTableWork().isEmpty())),
+ QUERY(parseContext -> parseContext.getQueryProperties().isQuery()),
+ ALL(parseContext -> true),
+ NONE(parseContext -> false);
Review Comment:
i still think that NONE is redundant, but I am fine to keep it
--
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]