Skip to content

Commit 9845049

Browse files
authored
Merge branch 'main' into isthmus-literal-agg
2 parents ed599da + a1e48c6 commit 9845049

38 files changed

Lines changed: 317 additions & 863 deletions

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ OSV_SCANNER_IMAGE := ghcr.io/google/osv-scanner:v2.3.5
44
scan:
55
ifdef component
66
./gradlew --quiet ':$(component):dependencies' --write-locks --configuration runtimeClasspath
7-
docker run --rm --volume './$(component)/gradle.lockfile:/gradle.lockfile' $(OSV_SCANNER_IMAGE) scan source --lockfile /gradle.lockfile
7+
docker run --rm \
8+
--volume './$(component)/gradle.lockfile:/gradle.lockfile' \
9+
--volume './osv-scanner.toml:/osv-scanner.toml' \
10+
$(OSV_SCANNER_IMAGE) scan source --lockfile /gradle.lockfile --config /osv-scanner.toml
811
else
912
$(MAKE) component=core scan
1013
$(MAKE) component=isthmus scan

core/src/main/java/io/substrait/expression/AbstractExpressionVisitor.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,6 @@ public O visit(Expression.BinaryLiteral expr, C context) throws E {
152152
return visitFallback(expr, context);
153153
}
154154

155-
/**
156-
* Visits a time literal.
157-
*
158-
* @param expr the time literal
159-
* @param context the visitation context
160-
* @return the visit result
161-
* @throws E if visitation fails
162-
*/
163-
@Override
164-
public O visit(Expression.TimeLiteral expr, C context) throws E {
165-
return visitFallback(expr, context);
166-
}
167-
168155
/**
169156
* Visits a precision time literal.
170157
*
@@ -191,32 +178,6 @@ public O visit(Expression.DateLiteral expr, C context) throws E {
191178
return visitFallback(expr, context);
192179
}
193180

194-
/**
195-
* Visits a timestamp literal.
196-
*
197-
* @param expr the timestamp literal
198-
* @param context the visitation context
199-
* @return the visit result
200-
* @throws E if visitation fails
201-
*/
202-
@Override
203-
public O visit(Expression.TimestampLiteral expr, C context) throws E {
204-
return visitFallback(expr, context);
205-
}
206-
207-
/**
208-
* Visits a timestamp-with-time-zone literal.
209-
*
210-
* @param expr the timestamp TZ literal
211-
* @param context the visitation context
212-
* @return the visit result
213-
* @throws E if visitation fails
214-
*/
215-
@Override
216-
public O visit(Expression.TimestampTZLiteral expr, C context) throws E {
217-
return visitFallback(expr, context);
218-
}
219-
220181
/**
221182
* Visits a precision timestamp literal.
222183
*

core/src/main/java/io/substrait/expression/Expression.java

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -421,75 +421,6 @@ public <R, C extends VisitationContext, E extends Throwable> R accept(
421421
}
422422
}
423423

424-
/**
425-
* @deprecated {@link TimestampLiteral} is deprecated in favor of {@link
426-
* PrecisionTimestampLiteral}
427-
*/
428-
@Value.Immutable
429-
@Deprecated
430-
abstract class TimestampLiteral implements Literal {
431-
/**
432-
* Returns the timestamp value of this literal in microseconds since epoch.
433-
*
434-
* @return the timestamp value
435-
*/
436-
public abstract long value();
437-
438-
@Override
439-
public Type getType() {
440-
return Type.withNullability(nullable()).TIMESTAMP;
441-
}
442-
443-
/**
444-
* Creates a new builder for constructing a TimestampLiteral.
445-
*
446-
* @return a new builder instance
447-
*/
448-
public static ImmutableExpression.TimestampLiteral.Builder builder() {
449-
return ImmutableExpression.TimestampLiteral.builder();
450-
}
451-
452-
@Override
453-
public <R, C extends VisitationContext, E extends Throwable> R accept(
454-
ExpressionVisitor<R, C, E> visitor, C context) throws E {
455-
return visitor.visit(this, context);
456-
}
457-
}
458-
459-
/**
460-
* @deprecated {@link TimeLiteral} is deprecated in favor of {@link PrecisionTimeLiteral}
461-
*/
462-
@Value.Immutable
463-
@Deprecated
464-
abstract class TimeLiteral implements Literal {
465-
/**
466-
* Returns the time value of this literal in microseconds since midnight.
467-
*
468-
* @return the time value
469-
*/
470-
public abstract long value();
471-
472-
@Override
473-
public Type getType() {
474-
return Type.withNullability(nullable()).TIME;
475-
}
476-
477-
/**
478-
* Creates a new builder for constructing a TimeLiteral.
479-
*
480-
* @return a new builder instance
481-
*/
482-
public static ImmutableExpression.TimeLiteral.Builder builder() {
483-
return ImmutableExpression.TimeLiteral.builder();
484-
}
485-
486-
@Override
487-
public <R, C extends VisitationContext, E extends Throwable> R accept(
488-
ExpressionVisitor<R, C, E> visitor, C context) throws E {
489-
return visitor.visit(this, context);
490-
}
491-
}
492-
493424
/** Represents a time literal with configurable precision. */
494425
@Value.Immutable
495426
abstract class PrecisionTimeLiteral implements Literal {
@@ -559,41 +490,6 @@ public <R, C extends VisitationContext, E extends Throwable> R accept(
559490
}
560491
}
561492

562-
/**
563-
* @deprecated {@link TimestampTZLiteral} is deprecated in favor of {@link
564-
* PrecisionTimestampTZLiteral}
565-
*/
566-
@Value.Immutable
567-
@Deprecated
568-
abstract class TimestampTZLiteral implements Literal {
569-
/**
570-
* Returns the timestamp with timezone value of this literal in microseconds since epoch.
571-
*
572-
* @return the timestamp value
573-
*/
574-
public abstract long value();
575-
576-
@Override
577-
public Type getType() {
578-
return Type.withNullability(nullable()).TIMESTAMP_TZ;
579-
}
580-
581-
/**
582-
* Creates a new builder for constructing a TimestampTZLiteral.
583-
*
584-
* @return a new builder instance
585-
*/
586-
public static ImmutableExpression.TimestampTZLiteral.Builder builder() {
587-
return ImmutableExpression.TimestampTZLiteral.builder();
588-
}
589-
590-
@Override
591-
public <R, C extends VisitationContext, E extends Throwable> R accept(
592-
ExpressionVisitor<R, C, E> visitor, C context) throws E {
593-
return visitor.visit(this, context);
594-
}
595-
}
596-
597493
/** Represents a timestamp literal with configurable precision. */
598494
@Value.Immutable
599495
abstract class PrecisionTimestampLiteral implements Literal {

core/src/main/java/io/substrait/expression/ExpressionCreator.java

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import io.substrait.util.DecimalUtil;
99
import java.math.BigDecimal;
1010
import java.nio.ByteBuffer;
11-
import java.time.Instant;
1211
import java.time.LocalDateTime;
1312
import java.time.LocalTime;
1413
import java.time.ZoneOffset;
@@ -162,19 +161,6 @@ public static Expression.DateLiteral date(boolean nullable, int value) {
162161
return Expression.DateLiteral.builder().nullable(nullable).value(value).build();
163162
}
164163

165-
/**
166-
* Creates a time literal expression.
167-
*
168-
* @param nullable whether the literal can be null
169-
* @param value the time value in microseconds since midnight
170-
* @return a TimeLiteral expression
171-
* @deprecated Time is deprecated in favor of PrecisionTime
172-
*/
173-
@Deprecated
174-
public static Expression.TimeLiteral time(boolean nullable, long value) {
175-
return Expression.TimeLiteral.builder().nullable(nullable).value(value).build();
176-
}
177-
178164
/**
179165
* Creates a precision time literal expression.
180166
*
@@ -209,94 +195,6 @@ public static Expression.PrecisionTimeLiteral precisionTime(boolean nullable, Lo
209195
return precisionTime(nullable, epochNano, 9);
210196
}
211197

212-
/**
213-
* Creates a timestamp literal expression.
214-
*
215-
* @param nullable whether the literal can be null
216-
* @param value the timestamp value in microseconds since epoch
217-
* @return a TimestampLiteral expression
218-
* @deprecated Timestamp is deprecated in favor of PrecisionTimestamp
219-
*/
220-
@Deprecated
221-
public static Expression.TimestampLiteral timestamp(boolean nullable, long value) {
222-
return Expression.TimestampLiteral.builder().nullable(nullable).value(value).build();
223-
}
224-
225-
/**
226-
* Creates a timestamp literal expression from a LocalDateTime.
227-
*
228-
* @param nullable whether the literal can be null
229-
* @param value the LocalDateTime value (interpreted as UTC)
230-
* @return a TimestampLiteral expression
231-
* @deprecated Timestamp is deprecated in favor of PrecisionTimestamp
232-
*/
233-
@Deprecated
234-
public static Expression.TimestampLiteral timestamp(boolean nullable, LocalDateTime value) {
235-
long epochMicro =
236-
TimeUnit.SECONDS.toMicros(value.toEpochSecond(ZoneOffset.UTC))
237-
+ TimeUnit.NANOSECONDS.toMicros(value.getNano());
238-
return timestamp(nullable, epochMicro);
239-
}
240-
241-
/**
242-
* Creates a timestamp literal expression from date/time components.
243-
*
244-
* @param nullable whether the literal can be null
245-
* @param year the year
246-
* @param month the month (1-12)
247-
* @param dayOfMonth the day of month (1-31)
248-
* @param hour the hour (0-23)
249-
* @param minute the minute (0-59)
250-
* @param second the second (0-59)
251-
* @param micros the microseconds (0-999999)
252-
* @return a TimestampLiteral expression
253-
* @deprecated Timestamp is deprecated in favor of PrecisionTimestamp
254-
*/
255-
@Deprecated
256-
public static Expression.TimestampLiteral timestamp(
257-
boolean nullable,
258-
int year,
259-
int month,
260-
int dayOfMonth,
261-
int hour,
262-
int minute,
263-
int second,
264-
int micros) {
265-
return timestamp(
266-
nullable,
267-
LocalDateTime.of(year, month, dayOfMonth, hour, minute, second)
268-
.withNano((int) TimeUnit.MICROSECONDS.toNanos(micros)));
269-
}
270-
271-
/**
272-
* Creates a timestamp with timezone literal expression.
273-
*
274-
* @param nullable whether the literal can be null
275-
* @param value the timestamp value in microseconds since epoch
276-
* @return a TimestampTZLiteral expression
277-
* @deprecated TimestampTZ is deprecated in favor of PrecisionTimestampTZ
278-
*/
279-
@Deprecated
280-
public static Expression.TimestampTZLiteral timestampTZ(boolean nullable, long value) {
281-
return Expression.TimestampTZLiteral.builder().nullable(nullable).value(value).build();
282-
}
283-
284-
/**
285-
* Creates a timestamp with timezone literal expression from an Instant.
286-
*
287-
* @param nullable whether the literal can be null
288-
* @param value the Instant value
289-
* @return a TimestampTZLiteral expression
290-
* @deprecated TimestampTZ is deprecated in favor of PrecisionTimestampTZ
291-
*/
292-
@Deprecated
293-
public static Expression.TimestampTZLiteral timestampTZ(boolean nullable, Instant value) {
294-
long epochMicro =
295-
TimeUnit.SECONDS.toMicros(value.getEpochSecond())
296-
+ TimeUnit.NANOSECONDS.toMicros(value.getNano());
297-
return timestampTZ(nullable, epochMicro);
298-
}
299-
300198
/**
301199
* Creates a precision timestamp literal expression.
302200
*

core/src/main/java/io/substrait/expression/ExpressionVisitor.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ public interface ExpressionVisitor<R, C extends VisitationContext, E extends Thr
111111
*/
112112
R visit(Expression.BinaryLiteral expr, C context) throws E;
113113

114-
/**
115-
* Visit a time literal.
116-
*
117-
* @param expr the time literal
118-
* @param context visitation context
119-
* @return visit result
120-
* @throws E on visit failure
121-
*/
122-
R visit(Expression.TimeLiteral expr, C context) throws E;
123-
124114
/**
125115
* Visit a precision time literal.
126116
*
@@ -141,26 +131,6 @@ public interface ExpressionVisitor<R, C extends VisitationContext, E extends Thr
141131
*/
142132
R visit(Expression.DateLiteral expr, C context) throws E;
143133

144-
/**
145-
* Visit a timestamp literal.
146-
*
147-
* @param expr the timestamp literal
148-
* @param context visitation context
149-
* @return visit result
150-
* @throws E on visit failure
151-
*/
152-
R visit(Expression.TimestampLiteral expr, C context) throws E;
153-
154-
/**
155-
* Visit a timestamp-with-timezone literal.
156-
*
157-
* @param expr the timestamp TZ literal
158-
* @param context visitation context
159-
* @return visit result
160-
* @throws E on visit failure
161-
*/
162-
R visit(Expression.TimestampTZLiteral expr, C context) throws E;
163-
164134
/**
165135
* Visit a precision timestamp literal.
166136
*

core/src/main/java/io/substrait/expression/proto/ExpressionProtoConverter.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ public Expression visit(
177177
return lit(bldr -> bldr.setNullable(expr.nullable()).setBinary(expr.value()));
178178
}
179179

180-
@Override
181-
public Expression visit(
182-
io.substrait.expression.Expression.TimeLiteral expr, EmptyVisitationContext context) {
183-
return lit(bldr -> bldr.setNullable(expr.nullable()).setTime(expr.value()));
184-
}
185-
186180
@Override
187181
public Expression visit(
188182
io.substrait.expression.Expression.PrecisionTimeLiteral expr,
@@ -203,18 +197,6 @@ public Expression visit(
203197
return lit(bldr -> bldr.setNullable(expr.nullable()).setDate(expr.value()));
204198
}
205199

206-
@Override
207-
public Expression visit(
208-
io.substrait.expression.Expression.TimestampLiteral expr, EmptyVisitationContext context) {
209-
return lit(bldr -> bldr.setNullable(expr.nullable()).setTimestamp(expr.value()));
210-
}
211-
212-
@Override
213-
public Expression visit(
214-
io.substrait.expression.Expression.TimestampTZLiteral expr, EmptyVisitationContext context) {
215-
return lit(bldr -> bldr.setNullable(expr.nullable()).setTimestampTz(expr.value()));
216-
}
217-
218200
@Override
219201
public Expression visit(
220202
io.substrait.expression.Expression.PrecisionTimestampLiteral expr,

0 commit comments

Comments
 (0)