>From Ritik Raj <[email protected]>:

Attention is currently required from: Wail Alkowaileet.

Ritik Raj has posted comments on this change by Ritik Raj. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773?usp=email )

Change subject: [ASTERIXDB-3684][STO] Support temporal types in Column
......................................................................


Patch Set 5:

(5 comments)

Commit Message:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773/comment/c0da7844_2fcb45b8?usp=email
 :
PS5, Line 23: DURATION and
            : INTERVAL
> Can you elaborate on why is that here?
Since duration and intervals are incomparable, hence it won't make sense ig to 
have min/max and compare them.

https://github.com/apache/asterixdb/blob/9f929ee2688a694a2d7e2987de82b372a833f381/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/ILogicalBinaryComparator.java#L42C53-L42C61


File 
asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/ColumnValueReaderFactory.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773/comment/02cc9753_1c9d2c1c?usp=email
 :
PS5, Line 89: case DATE:
            :                 return new DateValueReader();
            :             case TIME:
            :                 return new TimeValueReader();
            :             case YEARMONTHDURATION:
            :                 return new YearMonthDurationValueReader();
            :             case DATETIME:
            :                 return new DateTimeValueReader();
            :             case DAYTIMEDURATION:
            :                 return new DayTimeDurationValueReader();
            :             case DURATION:
            :                 return new DurationValueReader();
            :             case INTERVAL:
            :                 return new IntervalValueReader();
> Can any of these be a primaryKey? Then we need reader/writer w/ plain 
> encoding/decoding.
somehow I thought we get error when creating a dataset with non-primitive 
primary key, but on checking, its clearly not the case.

Thanks for pointing out 😊, will do the needful.


File 
asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/temporal/DurationValueReader.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773/comment/f47cc381_c0b687c2?usp=email
 :
PS5, Line 78:         // Compare using Asterix duration ordering: months first, 
then day-time milliseconds.
            :         IValueReference other = o.getBytes();
            :
            :         byte[] a = value.getByteArray();
            :         int ao = value.getStartOffset();
            :         int monthsA = IntegerPointable.getInteger(a, ao);
            :         long millisA = LongPointable.getLong(a, ao + 
Integer.BYTES);
            :
            :         byte[] b = other.getByteArray();
            :         int bo = other.getStartOffset();
            :         int monthsB = IntegerPointable.getInteger(b, bo);
            :         long millisB = LongPointable.getLong(b, bo + 
Integer.BYTES);
            :
            :         int cmp = Integer.compare(monthsA, monthsB);
            :         return cmp != 0 ? cmp : Long.compare(millisA, millisB);
> Minor: can we do the comparison of months before deserializing the values of 
> the daytime?
Ack!


File 
asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/temporal/IntervalValueReader.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773/comment/45f89e61_f801e942?usp=email
 :
PS5, Line 75: intervalTimeType
> Is this dynamic? Or determined upon creation of the reader?  […]
An Interval can be between date, time, and datetime.
where date and time are of 4bytes and datetime is of 8bytes.

It is dynamic, an interval type column can be of date interval, time interval 
or datetime interval.

It does feel like three types overloaded. I thought of this, if we could unwrap 
this into three different types, interval can become comparable.

as same type intervals can be compared.


File 
asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/DurationColumnValuesWriter.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773/comment/619c9c41_d20d5f51?usp=email
 :
PS5, Line 55: * NOTE: Since the columnar page-zero filter stores only two 
8-byte longs, we cannot safely create an
            :  * order-preserving single-long min/max representation for 
DURATION. This writer therefore stores the values, but
            :  * uses a conservative filter that avoids pruning based on 
DURATION filters.
> Cannot we do as we do w/ strings? filter using months only? At least that's 
> how DurtationValueReader […]
Yeah, that compare did confuse me, but Duration can't be compare
eg: P12MT12S and P11MT121241341412S

will give wrong result based on the comparison, as Month can't be converted 
into seconds.



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20773?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I1bdf63561cd5e7c73801380cf0a7c1b5be9c9248
Gerrit-Change-Number: 20773
Gerrit-PatchSet: 5
Gerrit-Owner: Ritik Raj <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Ritik Raj <[email protected]>
Gerrit-Reviewer: Wail Alkowaileet <[email protected]>
Gerrit-Attention: Wail Alkowaileet <[email protected]>
Gerrit-Comment-Date: Wed, 14 Jan 2026 14:36:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Wail Alkowaileet <[email protected]>

Reply via email to