pnowojski commented on a change in pull request #6787: [FLINK-8577][table]
Implement proctime DataStream to Table upsert conversion
URL: https://github.com/apache/flink/pull/6787#discussion_r236177333
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
##########
@@ -1101,6 +1114,10 @@ abstract class TableEnvironment(val config:
TableConfig) {
referenceByName(name, p).map((_, name))
case Alias(UnresolvedFieldReference(origName), name: String, _) =>
referenceByName(origName, p).map((_, name))
+ case (Key(UnresolvedFieldReference(name: String))) =>
Review comment:
Tbh, at this moment I'm not sure if adding `Key` as nested case class was a
good idea. It adds quite a lot of boiler plate and special handling in multiple
places, which contradicts a clean code.
I wonder if `UnresolvedFieldReference` shouldn't have some kind of "trait"
that's a primary key. Where by a "trait" I mean any way to determine if that's
a primary key or not. For example either some boolean flag or maybe introducing
an `UnresolvedKeyFieldReference` that extends from `UnresolvedFieldReference`?
I think both of those solutions would allow avoid this code/handling
duplication in most of the places and special handle `Key` only where it is
necessary.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services