Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4d8e756
Introduce type-parameterized array and map APIs; replace wrapper prim…
wmoustafa Dec 17, 2019
6f6fcc7
Eliminate further StdXXX primitive references and fix some tests
wmoustafa Jan 4, 2020
63bc427
Remove further StdData references
wmoustafa Jan 4, 2020
a3906a4
Allow for absolute paths instead of assuming defaultFS for UDF side f…
SurenNihalani Jan 14, 2020
3be8352
0.0.45 release (previous 0.0.44) + release notes updated [ci skip]
shipkit-org Jan 14, 2020
2b9da11
Disable Jacoco for platform tests (#37)
shardulm94 Feb 3, 2020
edd7db6
0.0.46 release (previous 0.0.45) + release notes updated [ci skip]
shipkit-org Feb 3, 2020
50326fe
Fixed presto UDF patch broken link (#41)
Mar 12, 2020
08be012
FileSystemUtils: remove an unreliable check for unit testing (#42)
SurenNihalani Apr 1, 2020
56ad907
0.0.47 release (previous 0.0.46) + release notes updated [ci skip]
shipkit-org Apr 1, 2020
c11f77d
Presto: Pass custom configuration object when using FileSystemUtils (…
shardulm94 Apr 14, 2020
2db1d70
0.0.48 release (previous 0.0.47) + release notes updated [ci skip]
shipkit-org Apr 14, 2020
7b123b3
Presto: Make ScalarFunctionImplementation state independent of StdUdf…
shardulm94 Apr 30, 2020
0df29c7
0.0.49 release (previous 0.0.48) + release notes updated [ci skip]
shipkit-org Apr 30, 2020
0961752
Upgrade to PrestoSQL 333 (#45)
lxynov May 8, 2020
5c1b84a
0.0.50 release (previous 0.0.49) + release notes updated [ci skip]
shipkit-org May 8, 2020
7f05f00
Address review comments
wmoustafa May 10, 2020
b08e633
Add support for StdFloat, StdDouble, and StdBinary (#46)
khaitranq Jun 23, 2020
75f4b24
0.0.51 release (previous 0.0.50) + release notes updated [ci skip]
shipkit-org Jun 23, 2020
e9def3e
Allow users to override main and test source set names, output direct…
jjoyce0510 Jun 26, 2020
cf2005e
0.0.52 release (previous 0.0.51) + release notes updated [ci skip]
shipkit-org Jun 26, 2020
638796b
Empty commit to release new version
shardulm94 Jun 30, 2020
92e9b21
Empty commit to release new version [ci skip-compare-publications]
shardulm94 Jun 30, 2020
6fc9a92
0.0.53 release (previous 0.0.52) + release notes updated [ci skip]
shipkit-org Jun 30, 2020
c181a5d
Plugin: Publish Presto thin jar which allows consumers to control dep…
shardulm94 Aug 10, 2020
e458f0a
0.0.54 release (previous 0.0.53) + release notes updated [ci skip]
shipkit-org Aug 10, 2020
9d6dfac
Hive: Struct data should not be converted to object array during StdS…
shardulm94 Aug 13, 2020
da5c54b
Remove slf4j-log4j12 from Transport dependency graph (#51)
shardulm94 Aug 13, 2020
d1b406b
Bump shipkit (#54)
shardulm94 Aug 13, 2020
8ad919d
0.0.55 release (previous 0.0.54) + release notes updated [ci skip]
shipkit-org Aug 13, 2020
9139512
Fix test SQL generation for binary inputs (#55)
shardulm94 Aug 17, 2020
de72ccf
0.0.56 release (previous 0.0.55) + release notes updated [ci skip]
shipkit-org Aug 17, 2020
5702f7a
Spark: Create index-based iterator for non-mutable map keySet and val…
raymondlam12 Sep 23, 2020
19006c2
0.0.57 release (previous 0.0.56) + release notes updated [ci skip]
shipkit-org Sep 23, 2020
466dbae
Avro: Support simple union schemas (#60)
khaitranq Nov 3, 2020
ce14537
0.0.58 release (previous 0.0.57) + release notes updated [ci skip]
shipkit-org Nov 4, 2020
7fc04aa
Support conversion of String type to Utf8 in AvroWrapper (#61)
curtiscwang Nov 10, 2020
0c2cc3d
0.0.59 release (previous 0.0.58) + release notes updated [ci skip]
shipkit-org Nov 10, 2020
9db51ec
Add Avro ENUM read support and fix String bug (#62)
raymondlam12 Nov 18, 2020
5b5740e
0.0.60 release (previous 0.0.59) + release notes updated [ci skip]
shipkit-org Nov 18, 2020
71825df
Build: Fail if there are checkstyle violations (#64)
cwsteinbach Nov 25, 2020
69fb8d2
0.0.61 release (previous 0.0.60) + release notes updated [ci skip]
shipkit-org Nov 26, 2020
09a8950
Add travis-build.sh for pre-commit testing from command line (#65)
cwsteinbach Nov 26, 2020
757697e
WIP: Rebase on master branch
wmoustafa Nov 30, 2020
c0b8125
Eliminate further StdXXX primitive references and fix some tests
wmoustafa Jan 4, 2020
4fcd233
Remove further StdData references
wmoustafa Jan 4, 2020
7695140
Address review comments
wmoustafa May 10, 2020
2c65955
WIP: Rebase on mater - continue
wmoustafa Nov 30, 2020
c2982fd
Merge git pull confilcts
wmoustafa Nov 30, 2020
0997121
Fix build errors
wmoustafa Feb 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,19 @@ private void processUDFClass(TypeElement udfClassElement) {
udfClassElement
);
} else {
String topLevelStdUdfClassName =
elementsOverridingTopLevelStdUDFMethods.iterator().next().getQualifiedName().toString();
TypeElement topLevelStdUdfTypeElement = elementsOverridingTopLevelStdUDFMethods.iterator().next();
String topLevelStdUdfClassName = topLevelStdUdfTypeElement.getQualifiedName().toString();
debug(String.format("TopLevelStdUDF class found: %s", topLevelStdUdfClassName));
String udfClassName = udfClassElement.getQualifiedName().toString();
_transportUdfMetadata.addUDF(topLevelStdUdfClassName, udfClassElement.getQualifiedName().toString());
_transportUdfMetadata.setClassNumberOfTypeParameters(
topLevelStdUdfClassName,
topLevelStdUdfTypeElement.getTypeParameters().size()
);
_transportUdfMetadata.setClassNumberOfTypeParameters(
udfClassName,
udfClassElement.getTypeParameters().size()
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
*/
package com.linkedin.transport.api;

import com.linkedin.transport.api.data.StdArray;
import com.linkedin.transport.api.data.StdBoolean;
import com.linkedin.transport.api.data.ArrayData;
import com.linkedin.transport.api.data.MapData;
import com.linkedin.transport.api.data.StdData;
import com.linkedin.transport.api.data.StdInteger;
import com.linkedin.transport.api.data.StdLong;
import com.linkedin.transport.api.data.StdMap;
import com.linkedin.transport.api.data.StdString;
import com.linkedin.transport.api.data.StdStruct;
import com.linkedin.transport.api.data.RowData;
import com.linkedin.transport.api.types.StdArrayType;
import com.linkedin.transport.api.types.StdMapType;
import com.linkedin.transport.api.types.StdStructType;
import com.linkedin.transport.api.types.RowType;
import com.linkedin.transport.api.types.StdType;
import com.linkedin.transport.api.udf.StdUDF;
import java.io.Serializable;
Expand All @@ -32,111 +28,79 @@
public interface StdFactory extends Serializable {

/**
* Creates a {@link StdInteger} representing a given integer value.
*
* @param value the input integer value
* @return {@link StdInteger} with the given integer value
*/
StdInteger createInteger(int value);

/**
* Creates a {@link StdLong} representing a given long value.
*
* @param value the input long value
* @return {@link StdLong} with the given long value
*/
StdLong createLong(long value);

/**
* Creates a {@link StdBoolean} representing a given boolean value.
*
* @param value the input boolean value
* @return {@link StdBoolean} with the given boolean value
*/
StdBoolean createBoolean(boolean value);

/**
* Creates a {@link StdString} representing a given {@link String} value.
*
* @param value the input {@link String} value
* @return {@link StdString} with the given {@link String} value
*/
StdString createString(String value);

/**
* Creates an empty {@link StdArray} whose type is given by the given {@link StdType}.
* Creates an empty {@link ArrayData} whose type is given by the given {@link StdType}.
*
* It is expected that the top-level {@link StdType} is a {@link StdArrayType}.
*
* @param stdType type of the array to be created
* @param expectedSize expected number of entries in the array
* @return an empty {@link StdArray}
* @return an empty {@link ArrayData}
*/
StdArray createArray(StdType stdType, int expectedSize);
ArrayData createArray(StdType stdType, int expectedSize);

/**
* Creates an empty {@link StdArray} whose type is given by the given {@link StdType}.
* Creates an empty {@link ArrayData} whose type is given by the given {@link StdType}.
*
* It is expected that the top-level {@link StdType} is a {@link StdArrayType}.
*
* @param stdType type of the array to be created
* @return an empty {@link StdArray}
* @return an empty {@link ArrayData}
*/
StdArray createArray(StdType stdType);
ArrayData createArray(StdType stdType);

/**
* Creates an empty {@link StdMap} whose type is given by the given {@link StdType}.
* Creates an empty {@link MapData} whose type is given by the given {@link StdType}.
*
* It is expected that the top-level {@link StdType} is a {@link StdMapType}.
*
* @param stdType type of the map to be created
* @return an empty {@link StdMap}
* @return an empty {@link MapData}
*/
StdMap createMap(StdType stdType);
MapData createMap(StdType stdType);

/**
* Creates a {@link StdStruct} with the given field names and types.
* Creates a {@link RowData} with the given field names and types.
*
* @param fieldNames names of the struct fields
* @param fieldTypes types of the struct fields
* @return a {@link StdStruct} with all fields initialized to null
* @return a {@link RowData} with all fields initialized to null
*/
StdStruct createStruct(List<String> fieldNames, List<StdType> fieldTypes);
RowData createStruct(List<String> fieldNames, List<StdType> fieldTypes);

/**
* Creates a {@link StdStruct} with the given field types. Field names will be field0, field1, field2...
* Creates a {@link RowData} with the given field types. Field names will be field0, field1, field2...
*
* @param fieldTypes types of the struct fields
* @return a {@link StdStruct} with all fields initialized to null
* @return a {@link RowData} with all fields initialized to null
*/
StdStruct createStruct(List<StdType> fieldTypes);
RowData createStruct(List<StdType> fieldTypes);

/**
* Creates a {@link StdStruct} whose type is given by the given {@link StdType}.
* Creates a {@link RowData} whose type is given by the given {@link StdType}.
*
* It is expected that the top-level {@link StdType} is a {@link StdStructType}.
* It is expected that the top-level {@link StdType} is a {@link RowType}.
*
* @param stdType type of the struct to be created
* @return a {@link StdStruct} with all fields initialized to null
* @return a {@link RowData} with all fields initialized to null
*/
StdStruct createStruct(StdType stdType);
RowData createStruct(StdType stdType);

/**
* Creates a {@link StdType} representing the given type signature.
*
* The following are considered valid type signatures:
* <ul>
* <li>{@code "varchar"} - Represents SQL varchar type. Corresponding standard type is {@link StdString}</li>
* <li>{@code "integer"} - Represents SQL int type. Corresponding standard type is {@link StdInteger}</li>
* <li>{@code "bigint"} - Represents SQL bigint/long type. Corresponding standard type is {@link StdLong}</li>
* <li>{@code "boolean"} - Represents SQL boolean type. Corresponding standard type is {@link StdBoolean}</li>
* <li>{@code "varchar"} - Represents SQL varchar type. Corresponding standard type is {@link String}</li>
* <li>{@code "integer"} - Represents SQL int type. Corresponding standard type is {@link Integer}</li>
* <li>{@code "bigint"} - Represents SQL bigint/long type. Corresponding standard type is {@link Long}</li>
* <li>{@code "boolean"} - Represents SQL boolean type. Corresponding standard type is {@link Boolean}</li>
* <li>{@code "array(T)"} - Represents SQL array type, where {@code T} is type signature of array element.
* Corresponding standard type is {@link StdArray}</li>
* Corresponding standard type is {@link ArrayData}</li>
* <li>{@code "map(K,V)"} - Represents SQL map type, where {@code K} and {@code V} are type signatures of the map
* keys and values respectively. array element. Corresponding standard type is {@link StdMap}</li>
* keys and values respectively. array element. Corresponding standard type is {@link MapData}</li>
* <li>{@code "row(f0 T0, f1 T1,... fn Tn)"} - Represents SQL struct type, where {@code f0}...{@code fn} are field
* names and {@code T0}...{@code Tn} are type signatures for the fields. Field names are optional; if not
* specified they default to {@code field0}...{@code fieldn}. Corresponding standard type is {@link StdStruct}</li>
* specified they default to {@code field0}...{@code fieldn}. Corresponding standard type is {@link RowData}</li>
* </ul>
*
* Generic type parameters can also be used as part of the type signatures; e.g., The type signature {@code "map(K,V)"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package com.linkedin.transport.api.data;

/** A Standard UDF data type for representing arrays. */
public interface StdArray extends StdData, Iterable<StdData> {
public interface ArrayData<E> extends Iterable<E> {

/** Returns the number of elements in the array. */
int size();
Expand All @@ -16,12 +16,12 @@ public interface StdArray extends StdData, Iterable<StdData> {
*
* @param idx the index of the element to be retrieved
*/
StdData get(int idx);
E get(int idx);

/**
* Adds an element to the end of the array.
*
* @param e the element to append to the array
*/
void add(StdData e);
void add(E e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


/** A Standard UDF data type for representing maps. */
public interface StdMap extends StdData {
public interface MapData<K, V> {

/** Returns the number of key-value pairs in the map. */
int size();
Expand All @@ -20,26 +20,26 @@ public interface StdMap extends StdData {
*
* @param key the key whose value is to be returned
*/
StdData get(StdData key);
V get(K key);

/**
* Adds the given value to the map against the given key.
*
* @param key the key to which the value is to be associated
* @param value the value to be associated with the key
*/
void put(StdData key, StdData value);
void put(K key, V value);

/** Returns a {@link Set} of all the keys in the map. */
Set<StdData> keySet();
Set<K> keySet();

/** Returns a {@link Collection} of all the values in the map. */
Collection<StdData> values();
Collection<V> values();

/**
* Returns true if the map contains the given key, false otherwise.
*
* @param key the key to be checked
*/
boolean containsKey(StdData key);
boolean containsKey(K key);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@
import java.util.List;


/** A Standard UDF data type for representing structs. */
public interface StdStruct extends StdData {
/** A Standard UDF data type for representing SQL ROW/STRUCT data type. */
public interface RowData {

/**
* Returns the value of the field at the given position in the struct.
* Returns the value of the field at the given position in the row.
*
* @param index the position of the field in the struct
* @param index the position of the field in the row
*/
StdData getField(int index);
Object getField(int index);

/**
* Returns the value of the given field from the struct.
* Returns the value of the given field from the row.
*
* @param name the name of the field
*/
StdData getField(String name);
Object getField(String name);

/**
* Sets the value of the field at the given position in the struct.
* Sets the value of the field at the given position in the row.
*
* @param index the position of the field in the struct
* @param index the position of the field in the row
* @param value the value to be set
*/
void setField(int index, StdData value);
void setField(int index, Object value);

/**
* Sets the value of the given field in the struct.
* Sets the value of the given field in the row.
*
* @param name the name of the field
* @param value the value to be set
*/
void setField(String name, StdData value);
void setField(String name, Object value);

/** Returns a {@link List} of all fields in the struct. */
List<StdData> fields();
List<Object> fields();
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* An interface for all data types in Standard UDFs.
*
* {@link StdData} is the main interface through which StdUDFs receive input data and return output data. All Standard
* UDF data types (e.g., {@link StdInteger}, {@link StdArray}, {@link StdMap}) must extend {@link StdData}. Methods
* UDF data types (e.g., {@link StdInteger}, {@link ArrayData}, {@link MapData}) must extend {@link StdData}. Methods
* inside {@link StdFactory} can be used to create {@link StdData} objects.
*/
public interface StdData {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


/** A {@link StdType} representing a struct type. */
public interface StdStructType extends StdType {
public interface RowType extends StdType {

/** Returns a {@link List} of the types of all the struct fields. */
List<? extends StdType> fieldTypes();
Expand Down
Loading