You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/20 21:10:22 UTC

[GitHub] [druid] mcbrewster opened a new pull request #9549: Add view values to lookup actions menu

mcbrewster opened a new pull request #9549: Add view values to lookup actions menu
URL: https://github.com/apache/druid/pull/9549
 
 
   On the look ups page you can now click on the magnifying glass icon to view the key value pairs of that lookup.
   
   <img width="1129" alt="Screen Shot 2020-03-20 at 3 09 24 PM" src="https://user-images.githubusercontent.com/37322608/77206532-cd5c5e00-6abc-11ea-9ea0-0680fa5de8cb.png">
   
   <img width="1184" alt="Screen Shot 2020-03-20 at 3 03 14 PM" src="https://user-images.githubusercontent.com/37322608/77206494-b584da00-6abc-11ea-8878-7b4e65a1ea6e.png">
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [druid] vogievetsky commented on issue #9549: Add view values to lookup actions menu

Posted by GitBox <gi...@apache.org>.
vogievetsky commented on issue #9549: Add view values to lookup actions menu
URL: https://github.com/apache/druid/pull/9549#issuecomment-603368340
 
 
   Looks great, thank you 👍 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [druid] vogievetsky commented on a change in pull request #9549: Add view values to lookup actions menu

Posted by GitBox <gi...@apache.org>.
vogievetsky commented on a change in pull request #9549: Add view values to lookup actions menu
URL: https://github.com/apache/druid/pull/9549#discussion_r396828001
 
 

 ##########
 File path: web-console/src/components/lookup-values-table/lookup-values-table.tsx
 ##########
 @@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import React from 'react';
+import ReactTable from 'react-table';
+
+import { queryDruidSql, QueryManager } from '../../utils';
+import { Loader } from '../loader/loader';
+
+import './lookup-values-table.scss';
+
+interface LookupRow {
+  k: string;
+  v: string;
+}
+
+export interface LookupColumnsTableProps {
+  lookupId: string;
+  downloadFilename?: string;
+}
+
+export interface LookupColumnsTableState {
+  columns?: LookupRow[];
+  loading: boolean;
+  error?: string;
+}
+
+export class LookupValuesTable extends React.PureComponent<
+  LookupColumnsTableProps,
+  LookupColumnsTableState
+> {
+  private LookupColumnsQueryManager: QueryManager<null, LookupRow[]>;
+
+  constructor(props: LookupColumnsTableProps, context: any) {
+    super(props, context);
+    this.state = {
+      loading: true,
+    };
+
+    this.LookupColumnsQueryManager = new QueryManager({
+      processQuery: async () => {
+        const { lookupId } = this.props;
+
+        const resp = await queryDruidSql<LookupRow>({
+          query: `SELECT * FROM lookup.${lookupId}`,
+        });
+
+        return resp.map(object => {
 
 Review comment:
   why is this map needed?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [druid] vogievetsky commented on a change in pull request #9549: Add view values to lookup actions menu

Posted by GitBox <gi...@apache.org>.
vogievetsky commented on a change in pull request #9549: Add view values to lookup actions menu
URL: https://github.com/apache/druid/pull/9549#discussion_r396827890
 
 

 ##########
 File path: web-console/src/components/lookup-values-table/lookup-values-table.tsx
 ##########
 @@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import React from 'react';
+import ReactTable from 'react-table';
+
+import { queryDruidSql, QueryManager } from '../../utils';
+import { Loader } from '../loader/loader';
+
+import './lookup-values-table.scss';
+
+interface LookupRow {
+  k: string;
+  v: string;
+}
+
+export interface LookupColumnsTableProps {
+  lookupId: string;
+  downloadFilename?: string;
+}
+
+export interface LookupColumnsTableState {
+  columns?: LookupRow[];
+  loading: boolean;
+  error?: string;
+}
+
+export class LookupValuesTable extends React.PureComponent<
+  LookupColumnsTableProps,
+  LookupColumnsTableState
+> {
+  private LookupColumnsQueryManager: QueryManager<null, LookupRow[]>;
+
+  constructor(props: LookupColumnsTableProps, context: any) {
+    super(props, context);
+    this.state = {
+      loading: true,
+    };
+
+    this.LookupColumnsQueryManager = new QueryManager({
+      processQuery: async () => {
+        const { lookupId } = this.props;
+
+        const resp = await queryDruidSql<LookupRow>({
+          query: `SELECT * FROM lookup.${lookupId}`,
 
 Review comment:
   A lookup can have lots and lots of values in it, also what if the columns change? I would recommend doing `SELECT k, v` instead of `*` and also adding a `LIMIT 5000` or something

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [druid] vogievetsky merged pull request #9549: Add view values to lookup actions menu

Posted by GitBox <gi...@apache.org>.
vogievetsky merged pull request #9549: Add view values to lookup actions menu
URL: https://github.com/apache/druid/pull/9549
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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