vogievetsky commented on a change in pull request #9705: add joins to column 
tree menu
URL: https://github.com/apache/druid/pull/9705#discussion_r409260161
 
 

 ##########
 File path: web-console/src/views/query-view/column-tree/column-tree.tsx
 ##########
 @@ -188,6 +214,73 @@ export class ColumnTree extends 
React.PureComponent<ColumnTreeProps, ColumnTreeS
                                 }}
                               />
                             )}
+                            {parsedQuery && schema === 'lookup' && (
+                              <MenuItem
+                                popoverProps={{ openOnTargetFocus: false }}
+                                icon={IconNames.JOIN_TABLE}
+                                text={parsedQuery.joinTable ? `Replace Join` : 
`Join`}
+                              >
+                                <MenuItem
+                                  icon={IconNames.LEFT_JOIN}
+                                  text={`Left Join`}
+                                  onClick={() => {
+                                    const { lookupColumn, originalTableColumn 
} = getCurrentColumns(
+                                      parsedQuery,
+                                      table,
+                                    );
+                                    props.onQueryStringChange(
+                                      parsedQuery.addJoin(
+                                        'LEFT',
+                                        SqlRef.fromString(table, 
schema).upgrade(),
+                                        SqlMulti.sqlMultiFactory('=', [
+                                          SqlRef.fromString(lookupColumn, 
table, 'lookup'),
+                                          SqlRef.fromString(
+                                            originalTableColumn,
+                                            parsedQuery.getTableName(),
+                                          ),
+                                        ]),
+                                      ),
+                                      false,
+                                    );
+                                  }}
+                                />
+                                <MenuItem
+                                  icon={IconNames.INNER_JOIN}
+                                  text={`Inner Join`}
 
 Review comment:
   Sentence case 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to