You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/07 12:26:34 UTC

[GitHub] [incubator-doris] littleeleventhwolf opened a new pull request, #8906: [feat](sql) support star exclude modifier

littleeleventhwolf opened a new pull request, #8906:
URL: https://github.com/apache/incubator-doris/pull/8906

   When we query many fields in a wide-table,
   but ignore one field or two fields,
   we need to write out fields we need one by one.
   Therefore, try to use `select * exclude (excluded_item1, excluded_item2, ...)`,
   the sql will be simplified.
   
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   2. Has unit tests been added: (No)
   3. Has document been added or modified: (Yes)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #8906: [feat](sql) support star except modifier

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8906:
URL: https://github.com/apache/doris/pull/8906#issuecomment-1272418261

   We're closing this PR because it hasn't been updated in a while.
   This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] littleeleventhwolf commented on a diff in pull request #8906: [feat](sql) support star except modifier

Posted by GitBox <gi...@apache.org>.
littleeleventhwolf commented on code in PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#discussion_r847029355


##########
fe/fe-core/src/main/cup/sql_parser.cup:
##########
@@ -544,6 +544,7 @@ precedence left KW_LIKE, KW_REGEXP;
 precedence left EQUAL, LESSTHAN, GREATERTHAN;
 precedence left ADD, SUBTRACT;
 precedence left AT, STAR, DIVIDE, MOD, KW_DIV;
+precedence left KW_EXCEPT;

Review Comment:
   Because `select * except (field)` always match syntax below. 
   ```
   select_list ::=
   ... ...
       | STAR
       {:
           SelectList list = new SelectList();
           list.addItem(SelectListItem.createStarItem(null));
           RESULT = list;
       :}
   ```



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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] morningman commented on pull request #8906: [feat](sql) support star exclude modifier

Posted by GitBox <gi...@apache.org>.
morningman commented on PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#issuecomment-1091920554

   I found discussion here: https://stackoverflow.com/questions/729197/exclude-a-column-using-select-except-columna-from-tablea


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] closed pull request #8906: [feat](sql) support star except modifier

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #8906: [feat](sql) support star except modifier
URL: https://github.com/apache/doris/pull/8906


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] EmmyMiao87 commented on a diff in pull request #8906: [feat](sql) support star except modifier

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on code in PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#discussion_r846036375


##########
fe/fe-core/src/main/cup/sql_parser.cup:
##########
@@ -544,6 +544,7 @@ precedence left KW_LIKE, KW_REGEXP;
 precedence left EQUAL, LESSTHAN, GREATERTHAN;
 precedence left ADD, SUBTRACT;
 precedence left AT, STAR, DIVIDE, MOD, KW_DIV;
+precedence left KW_EXCEPT;

Review Comment:
   What is the purpose of adding this line?



##########
fe/fe-core/src/main/cup/sql_parser.cup:
##########
@@ -4007,6 +4015,12 @@ select_sublist ::=
         list.addItem(SelectListItem.createStarItem(null));
         RESULT = list;
     :}
+    | select_sublist:list COMMA STAR except_list:exceptList

Review Comment:
   What's this mean ```select a, * except (a)```



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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] EmmyMiao87 commented on pull request #8906: [feat](sql) support star exclude modifier

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#issuecomment-1092541138

   It is best to be consistent with the sql of the data warehouse that supports this kind of syntax.


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] littleeleventhwolf commented on a diff in pull request #8906: [feat](sql) support star except modifier

Posted by GitBox <gi...@apache.org>.
littleeleventhwolf commented on code in PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#discussion_r847033485


##########
fe/fe-core/src/main/cup/sql_parser.cup:
##########
@@ -4007,6 +4015,12 @@ select_sublist ::=
         list.addItem(SelectListItem.createStarItem(null));
         RESULT = list;
     :}
+    | select_sublist:list COMMA STAR except_list:exceptList

Review Comment:
   It's up to the user to decide their own select_list. If user give sql `select a, * except (a)`, field `a` before comma also be projected, `* except (a)` after comma will remove `a` from all columns and then be projected.



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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] jackwener commented on pull request #8906: [feat](sql) support star exclude modifier

Posted by GitBox <gi...@apache.org>.
jackwener commented on PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#issuecomment-1091791307

   Thanks for your contribution❤. It's not a little PR. 
   
   This feature deserves discussion.
   
   IMHO, I don't that it's a very necessary feature. I find that:
   
   -  standard SQL don't include it.
   -  MySQL/PG and so on don't implement this feature.
   
   Maybe we can talk about it about necessity, usefulness ....
   
   cc @EmmyMiao87 


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] littleeleventhwolf commented on pull request #8906: [feat](sql) support star exclude modifier

Posted by GitBox <gi...@apache.org>.
littleeleventhwolf commented on PR #8906:
URL: https://github.com/apache/incubator-doris/pull/8906#issuecomment-1092737543

   > It is best to be consistent with the sql of the data warehouse that supports this kind of syntax.
   
   I try to make it similar to BigQuery, using `except` dialect.


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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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