hanyuzheng7 commented on PR #22834: URL: https://github.com/apache/flink/pull/22834#issuecomment-1618845823
> This query seems returns an incorrect result > > ```sql > SELECT array_slice(ARRAY[1, 2, 3, 4, 5], -123, -231); -- returns [1] and this is NOT OK, i would expect empty array [] > ``` > > same issue for positive > > ```sql > SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 123, 231); --returns [5] and this is NOT OK > ``` > > another query with strange result > > ```sql > SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 3, -7); -- returns 0, this is OK > ``` > > however > > ```sql > SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 0, -7); -- returns [1], this is NOT OK > SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 1, -7); -- returns [1], this is NOT OK > ``` according our definition, ``` SELECT array_slice(ARRAY[1, 2, 3, 4, 5], -123, -231); -- returns [1] SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 123, 231); --returns [5] SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 3, -7); -- returns[1,2,3] SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 0, -7); -- returns [1] SELECT array_slice(ARRAY[1, 2, 3, 4, 5], 1, -7); -- returns [1] ``` -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org