height
// tag::height[]
FROM employees
| DROP height
// end::height[]
| LIMIT 0;

avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | height.float:double | height.half_float:double | height.scaled_float:double | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer |salary_change.keyword:keyword |salary_change.long:long | still_hired:boolean
;

heightWithWildcard
// tag::heightWithWildcard[]
FROM employees 
| DROP height*
// end::heightWithWildcard[]
| LIMIT 0;

avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer |salary_change.keyword:keyword |salary_change.long:long | still_hired:boolean
;

sortWithLimitOne_DropHeight
from employees | sort languages, emp_no | limit 1 | drop height*;

avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer |salary_change.keyword:keyword |salary_change.long:long | still_hired:boolean
244294991         |1955-01-21T00:00:00.000Z|10005          |Kyoichi        |M              |1989-09-12T00:00:00.000Z|[false, false, false, true]|null           |1              |1              |1              |1              |Maliniak       |63528          |[-2.14, 13.07] |[-2, 13]        |[-2.14, 13.07] |[-2, 13]          |true
;

simpleEvalWithSortAndLimitOne_DropHeight
from employees | eval x = languages + 7 | sort x, emp_no | limit 1 | drop height*;

avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer |salary_change.keyword:keyword |salary_change.long:long | still_hired:boolean | x:integer
244294991         |1955-01-21T00:00:00.000Z|10005          |Kyoichi        |M              |1989-09-12T00:00:00.000Z|[false, false, false, true]|null           |1              |1              |1              |1              |Maliniak       |63528          |[-2.14, 13.07] |[-2, 13]         |[-2.14, 13.07] |[-2, 13]          |true           |8
;

whereWithEvalGeneratedValue_DropHeight
from employees | sort emp_no | eval x = salary / 2 | where x > 37000 | drop height*;

avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer |salary_change.keyword:keyword |salary_change.long:long | still_hired:boolean | x:integer
393084805         |1957-05-23T00:00:00.000Z|10007          |Tzvetan        |F              |1989-02-10T00:00:00.000Z|[false, false, true, true]|null                                                                        |4              |4              |4              |4              |Zielinski      |74572          |[-7.06, 0.57, 1.99] |[-7, 0, 1]       |[-7.06, 0.57, 1.99]  |[-7, 0, 1]        |true           |37286          
257694181         |1956-12-13T00:00:00.000Z|10029          |Otmar          |M              |1985-11-20T00:00:00.000Z|true                      |[Data Scientist, Principal Support Engineer, Senior Python Developer]       |null           |null           |null           |null           |Herbst         |74999          |[-8.19, -1.9, -0.32]|[-8, -1, 0]      |[-0.32, -1.90, -8.19]|[-8, -1, 0]       |false          |37499          
371418933         |null                    |10045          |Moss           |M              |1989-09-02T00:00:00.000Z|[false, true]             |[Accountant, Junior Developer, Principal Support Engineer, Purchase Manager]|3              |3              |3              |3              |Shanbhogue     |74970          |null                |null             |null                 |null              |false          |37485            
;

projectDropWithWildcardKeepOthers
row a = 1+3, b = 2, ab = 5 | eval x = 1 + b + 5 | eval abc = x * 2 | drop a* | keep b,x;

b:integer | x:integer
2 | 8
;

dropAllColumns
from employees | keep height | drop height | eval x = 1;

x:integer
;

dropAllColumns_WithLimit
from employees | keep height | drop height | eval x = 1 | limit 3;

x:integer
;

dropAllColumns_WithCount
from employees | keep height | drop height | eval x = 1 | stats c=count(x);

c:long
0
;

dropAllColumns_WithStats
from employees | keep height | drop height | eval x = 1 | stats c=count(x), mi=min(x), s=sum(x);

c:l|mi:i|s:l
0  |null|null
;


// see https://github.com/elastic/elasticsearch/issues/102121
dropGrouping#[skip:-8.11.99, reason:planning bug fixed in v8.12]
row a = 1 | rename a AS foo | stats bar = count(*) by foo | drop foo;

bar:long
1
;

dropGroupingMulti#[skip:-8.11.99]
row a = 1, b = 2 | rename a AS foo, b as bar | stats baz = count(*) by foo, bar | drop foo;

baz:long  | bar:integer
1         | 2
;

dropGroupingMulti2#[skip:-8.11.99]
row a = 1, b = 2 | rename a AS foo, b as bar | stats baz = count(*) by foo, bar | drop foo, bar;

baz:long
1
;


dropGroupingMultirow#[skip:-8.11.99]
from employees | rename gender AS foo | stats bar = count(*) by foo | drop foo | sort bar;

bar:long
10
33
57
;

dropColumnWithQuotedWildcard#[skip:-8.12.99]
FROM employees | STATS ROUND(AVG(height * 1.5)), COUNT(*), MIN(salary  * 10) | DROP `MIN(salary  * 10)`
;

ROUND(AVG(height * 1.5)):d | COUNT(*):l
3.0                        | 100
;

dropColumnWithQuotedWildcardBasic#[skip:-8.12.99]
FROM employees | STATS COUNT(*), MIN(salary  * 10), MAX(languages)| DROP `COUNT(*)`
;

MIN(salary  * 10):i | MAX(languages):i
253240              | 5
;

// Not really shadowing, but let's keep the name consistent with the other command's tests
shadowingInternal
FROM employees
| SORT emp_no ASC
| KEEP emp_no, first_name, last_name
| DROP last_name, last_name
| LIMIT 2
;

emp_no:integer | first_name:keyword
         10001 | Georgi
         10002 | Bezalel
;

shadowingInternalWildcard
FROM employees
| SORT emp_no ASC
| KEEP emp_no, first_name, last_name
| DROP last*name, last*name, last*, last_name
| LIMIT 2
;

emp_no:integer | first_name:keyword
         10001 | Georgi
         10002 | Bezalel
;

subfields
FROM addresses
| DROP city.country.continent.planet.name, city.country.continent.name, city.country.name, number, street, zip_code, city.country.continent.planet.name
| SORT city.name
;

city.country.continent.planet.galaxy:keyword | city.name:keyword
Milky Way                                    | Amsterdam
Milky Way                                    | San Francisco
Milky Way                                    | Tokyo
;

subfieldsWildcard
FROM addresses
| DROP *.name, number, street, zip_code, *ame
;

city.country.continent.planet.galaxy:keyword
Milky Way
Milky Way
Milky Way
;

dropAgainWithWildcardAfterEval
required_capability: drop_again_with_wildcard_after_eval
from languages
| eval language_code = 12, x = 13
| drop language_code
| drop language*
| keep x
| limit 3
;

x:integer
13
13
13
;
