Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vkorukanti committed Aug 22, 2023
1 parent 853edbd commit 472d32a
Show file tree
Hide file tree
Showing 16 changed files with 442 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Collections;
import java.util.List;

import io.delta.kernel.types.DataType;
import io.delta.kernel.types.StructType;

/**
Expand All @@ -36,24 +35,24 @@
public final class Column implements Expression {
private final int ordinal;
private final String name;
private final DataType dataType;

public Column(int ordinal, String name, DataType dataType) {
public Column(int ordinal, String name) {
this.ordinal = ordinal;
this.name = name;
this.dataType = dataType;
}

public String getName() {
return name;
}

/**
* @return the ordinal of the column in the input columnar batch.
*/
public int getOrdinal() {
return ordinal;
}

public DataType getDataType() {
return dataType;
/**
* @return the column name.
*/
public String getName() {
return name;
}

@Override
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@
import java.util.List;

/**
* Base interface for all Kernel expression
* Base interface for all Kernel expressions.
*/
public interface Expression {
/**
* @return the String representation of this expression.
*/
String toString();

/**
* @return a {@link List} of the immediate children of this node
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (2023) The Delta Lake Project Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.delta.kernel.expressions.predicate;

import java.util.Collections;

/**
* Predicate which always evaluates to {@code false}.
*/
public final class AlwaysFalse extends Predicate {
public AlwaysFalse() {
super("ALWAYS_FALSE", Collections.emptyList());
}

@Override
public String toString() {
return "false";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (2023) The Delta Lake Project Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.delta.kernel.expressions.predicate;

import java.util.Collections;

/**
* Predicate which always evaluates to {@code true}.
*/
public final class AlwaysTrue extends Predicate {
public AlwaysTrue() {
super("ALWAYS_TRUE", Collections.emptyList());
}

@Override
public String toString() {
return "true";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.delta.kernel.expressions;
package io.delta.kernel.expressions.predicate;

import java.util.Arrays;

/**
* {@code AND} expression
* <p>
* Definition:
* <p><ul>
* <li>Logical {@code expr1} AND {@code expr2} on two inputs.</li>
* <li>Requires both left and right input expressions evaluate to be {@link Predicate}.</li>
* <li>Result is null if one or both of the inputs are null.</li>
* <p>
* <ul>
* <li>Logical {@code expr1} AND {@code expr2} on two inputs.</li>
* <li>Requires both left and right input expressions evaluate to be {@link Predicate}.</li>
* <li>Result is null if one or both of the inputs are null.</li>
* </ul>
*/
public final class And extends Predicate {
public And(Predicate left, Predicate right) {
super(Arrays.asList(left, right));
super("AND", Arrays.asList(left, right));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.delta.kernel.expressions;
package io.delta.kernel.expressions.predicate;

import java.util.Arrays;

Expand All @@ -29,7 +29,7 @@
*/
public final class Or extends Predicate {
public Or(Predicate left, Predicate right) {
super(Arrays.asList(left, right));
super("OR", Arrays.asList(left, right));
}

/**
Expand Down
Loading

0 comments on commit 472d32a

Please sign in to comment.