You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/07/16 07:01:32 UTC

[GitHub] [incubator-superset] villebro opened a new pull request #10336: fix: make __time an ok column name in SQL Lab

villebro opened a new pull request #10336:
URL: https://github.com/apache/incubator-superset/pull/10336


   ### SUMMARY
   Currently all double underscore prefixed column names are considered reserved in SQL Lab, despite only `__timestamp` being truly reserved. This causes trouble when querying Druid SQL datasources, as it unnecessarily prohibits exploration of queries with the standard `__time` column found in Druid tables.
   
   ### TEST PLAN
   CI + new test
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro commented on a change in pull request #10336: fix: make __time an ok column name in SQL Lab

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #10336:
URL: https://github.com/apache/incubator-superset/pull/10336#discussion_r455553406



##########
File path: superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
##########
@@ -104,7 +104,7 @@ class ExploreResultsButton extends React.PureComponent {
   getInvalidColumns() {
     const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum
     const re2 = /__\d+$/; // does not finish with __ and then a number which screams dup col name
-    const re3 = /^__/; // is not a reserved column name e.g. __timestamp
+    const re3 = /^__timestamp/i; // is not a reserved temporal column alias

Review comment:
       the trailing `/i` to make matching case-insensitive.




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro commented on a change in pull request #10336: fix: make __time an ok column name in SQL Lab

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #10336:
URL: https://github.com/apache/incubator-superset/pull/10336#discussion_r455553406



##########
File path: superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
##########
@@ -104,7 +104,7 @@ class ExploreResultsButton extends React.PureComponent {
   getInvalidColumns() {
     const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum
     const re2 = /__\d+$/; // does not finish with __ and then a number which screams dup col name
-    const re3 = /^__/; // is not a reserved column name e.g. __timestamp
+    const re3 = /^__timestamp/i; // is not a reserved temporal column alias

Review comment:
       the trailing `/i` to make matching cases-insensitive.




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro merged pull request #10336: fix: make __time an ok column name in SQL Lab

Posted by GitBox <gi...@apache.org>.
villebro merged pull request #10336:
URL: https://github.com/apache/incubator-superset/pull/10336


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org