Feature Request P2
Status Update
Comments
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
ka...@gmail.com <ka...@gmail.com> #2
اثبات ملكية نشاطي التجارى
ma...@gmail.com <ma...@gmail.com> #3
good job google, 2 years to fix this issue. docu still says
ANY_VALUE behaves as if IGNORE NULLS is specified.
WELL BUDDY BOYS, IT CERTAINLY DOES NOT!
ANY_VALUE behaves as if IGNORE NULLS is specified.
WELL BUDDY BOYS, IT CERTAINLY DOES NOT!
gr...@gmail.com <gr...@gmail.com> #4
Thank you for pointing out that the google documentation has been updated to:
ANY_VALUE behaves as if IGNORE NULLS is specified; rows for which expression is NULL are not considered and won't be selected.
This is exact what the command ANY_VALUE does. It ignores NULLS. Thank you for updating the documentation. Please close this threat as done.
ar...@cohere.com <ar...@cohere.com> #5
It doesn't seem to actually do that though, at least from what I'm seeing:
Modifying the example in the docs to include a null, I tried:
WITH fruits AS (
SELECT "apple" fruit, 3.55 price UNION ALL
SELECT "banana" fruit, 2.10 price UNION ALL
SELECT null fruit, 4.30 price
)
SELECT ANY_VALUE(fruit HAVING MAX price) as fruit
FROM fruits;
The result given is null, rather than "apple". Am I misunderstanding or is that not what is described in the documentation?
Modifying the example in the docs to include a null, I tried:
WITH fruits AS (
SELECT "apple" fruit, 3.55 price UNION ALL
SELECT "banana" fruit, 2.10 price UNION ALL
SELECT null fruit, 4.30 price
)
SELECT ANY_VALUE(fruit HAVING MAX price) as fruit
FROM fruits;
The result given is null, rather than "apple". Am I misunderstanding or is that not what is described in the documentation?
ed...@gmail.com <ed...@gmail.com> #6
I also ANY_VALUE
only ignores NULL
s when not using HAVING
. From the docs, it's not clear to me if this is the intended behavior or not.
Description
This will create a public issue which anybody can view and comment on.
Problem you have encountered:
any_value
command behaves differently than described in the reference. The reference states thatNULL
values can be selected. In the current implentation, however, onlyNULL
is returned if there are no other entries.NULL
value is returned and that the sorting of the column or table is taken into account.What you expected to happen:
Please correct the documentation to:
ANY_VALUE
behaves as ifIGNORE NULLS
is specified;NULL
is only returned if all entries are NULL."Please add the following description to the second example (with "ANY_VALUE(fruit) OVER (ORDER BY ... " ) :
order by
the column is sorted,any_value
will return then the first notNULL
entry. "Steps to reproduce:
The behavior of the current implentation with respect to
any_value
can be tested with the following query:Other information (workarounds you have tried, documentation consulted, etc):