Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
huan233usc committed Mar 4, 2025
1 parent 0b0d97e commit 25dd404
Showing 1 changed file with 0 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,6 @@ public ColumnVector getElements() {
};
}

/**
* Creates an {@link ArrayValue} from list of strings. The type {@code array(string)} is a common
* occurrence in Delta Log schema. We don't have any non-string array type in Delta Log. If we end
* up needing to support other types, we can make this generic.
*
* @param values list of strings
* @return an {@link ArrayValue} with the given values of type {@link StringType}
*/
public static ArrayValue longArrayValue(List<Long> values) {
if (values == null) {
return null;
}
return new ArrayValue() {
@Override
public int getSize() {
return values.size();
}

@Override
public ColumnVector getElements() {
return longVector(values);
}
};
}

/**
* Creates a {@link MapValue} from map of string keys and string values. The type {@code
* map(string -> string)} is a common occurrence in Delta Log schema.
Expand Down Expand Up @@ -189,43 +164,6 @@ public String getString(int rowId) {
};
}

/**
* Utility method to create a {@link ColumnVector} for given list of strings.
*
* @param values list of strings
* @return a {@link ColumnVector} with the given values of type {@link StringType}
*/
public static ColumnVector longVector(List<Long> values) {
return new ColumnVector() {
@Override
public DataType getDataType() {
return LongType.LONG;
}

@Override
public int getSize() {
return values.size();
}

@Override
public void close() {
// no-op
}

@Override
public boolean isNullAt(int rowId) {
checkArgument(rowId >= 0 && rowId < values.size(), "Invalid rowId: %s", rowId);
return values.get(rowId) == null;
}

@Override
public long getLong(int rowId) {
checkArgument(rowId >= 0 && rowId < values.size(), "Invalid rowId: %s", rowId);
return values.get(rowId);
}
};
}

/**
* Gets the value at {@code rowId} from the column vector. The type of the Object returned depends
* on the data type of the column vector. For complex types array and map, returns the value as
Expand Down

0 comments on commit 25dd404

Please sign in to comment.