DaZuiZui commented on issue #17798:
URL: https://github.com/apache/iotdb/issues/17798#issuecomment-4589399439

   ## Proposed Definition for FILL METHOD NEXT
   
   ### Syntax
   
   FILL METHOD NEXT
   FILL METHOD NEXT TIME_BOUND <interval>
   FILL METHOD NEXT TIME_COLUMN <columnIndex> FILL_GROUP <columnIndex>[, ...]
   FILL METHOD NEXT TIME_BOUND <interval> TIME_COLUMN <columnIndex>
   FILL METHOD NEXT TIME_BOUND <interval> TIME_COLUMN <columnIndex> FILL_GROUP 
<columnIndex>[, ...]
   
   ### Scope
   
   Only table model is supported. Tree model behavior is not changed.
   
   ### Semantics
   
   NEXT fills a null value with the nearest non-null value that appears later 
in the current operator input order. It does not interpolate and does not 
search by timestamp order independently.
   
   If no later non-null value exists, the result remains null.
   
   When TIME_BOUND is specified, the candidate next value is used only if the 
time difference between the current row and the candidate row is within the 
bound.
   
   When FILL_GROUP is specified, the next value can only be searched inside the 
same group.
   
   ### Supported Data Types
   
   NEXT supports the same value types as PREVIOUS:
   BOOLEAN, INT32, INT64, FLOAT, DOUBLE, DATE, TIMESTAMP, TEXT, STRING, BLOB, 
OBJECT.
   
   ### TIME_COLUMN
   
   TIME_COLUMN is only required when TIME_BOUND or FILL_GROUP needs a helper 
time column. Plain FILL METHOD NEXT does not require a timestamp column in the 
select list.
   
   ## Clarified Feature Definition for `FILL METHOD NEXT`
   
   `NEXT` fill is only for the table model. Tree model behavior is out of scope.
   
   ### Syntax
   
   `NEXT` mirrors `PREVIOUS`:
   
   ```sql
   FILL METHOD NEXT
   FILL METHOD NEXT TIME_BOUND <interval>
   FILL METHOD NEXT TIME_COLUMN <columnIndex> FILL_GROUP <columnIndex>[, ...]
   FILL METHOD NEXT TIME_BOUND <interval> TIME_COLUMN <columnIndex>
   FILL METHOD NEXT TIME_BOUND <interval> TIME_COLUMN <columnIndex> FILL_GROUP 
<columnIndex>[, ...]
   
   Specifying TIME_COLUMN alone without TIME_BOUND or FILL_GROUP is invalid, 
consistent with PREVIOUS.
   
   ### Examples
   
   SELECT time, s1 FROM table1 FILL METHOD NEXT;
   
   SELECT time, s1 FROM table1
   FILL METHOD NEXT TIME_BOUND 2ms;
   
   SELECT time, device, s1 FROM table1
   FILL METHOD NEXT FILL_GROUP 2;
   
   SELECT time, device, s1 FROM table1
   FILL METHOD NEXT TIME_BOUND 2ms TIME_COLUMN 1 FILL_GROUP 2;
   
   ### Compatibility
   
   PREVIOUS, LINEAR, and CONSTANT semantics are unchanged.
   
   FillPolicy.NEXT will be appended to the enum to avoid changing existing 
serialized ordinal/byte values.
   
   ### LIMIT/OFFSET
   
   NEXT needs future rows for look-ahead, so LIMIT/OFFSET pushdown must be 
disabled for plans containing NEXT fill, similar to LINEAR.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to