hit-lacus commented on a change in pull request #241: KYLIN-3546 Add column
which belongs to root fact table in join relation but lost
URL: https://github.com/apache/kylin/pull/241#discussion_r219443869
##########
File path:
source-kafka/src/main/java/org/apache/kylin/source/kafka/KafkaInputBase.java
##########
@@ -89,7 +95,28 @@ public DataModelDesc getDataModel() {
@Override
public List<TblColRef> getAllColumns() {
- return flatDesc.getFactColumns();
+ final Set<TblColRef> factTableColumnSet = Sets.newHashSet();
+ TableRef rootFactTable = getDataModel().getRootFactTable();
+ for (TblColRef col : flatDesc.getAllColumns()) {
+ if (col.getTableRef().equals(rootFactTable)) {
+ factTableColumnSet.add(col);
+ }
+ }
+ // Add column which belongs to root fact table in join
relation but lost
+ for (JoinTableDesc joinTableDesc :
getDataModel().getJoinTables()) {
+ JoinDesc jd = joinTableDesc.getJoin();
+ for (TblColRef colRef : jd.getForeignKeyColumns()) {
+ if (colRef.getTableRef().equals(rootFactTable)) {
+ factTableColumnSet.add(colRef);
+ }
+ }
+ for (TblColRef colRef : jd.getPrimaryKeyColumns()) {
Review comment:
OK, I will fix it.
----------------------------------------------------------------
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