Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Return Correct Type Information for Fields #365

Merged
merged 8 commits into from
Feb 21, 2020
Prev Previous commit
addressed further comments
davidcui1225 committed Feb 21, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 32f1fa5054112320146882bc29cc03fa05c193db
Original file line number Diff line number Diff line change
@@ -974,15 +974,12 @@ public String getCastScriptStatement(String name, String castType, List<KVValue>
* it might be safely treated as INTEGER.
*/
public static Schema.Type getScriptFunctionReturnType(MethodField field, Schema.Type resolvedType) {
Schema.Type returnType;
String functionName = ((ScriptMethodField) field).getFunctionName().toLowerCase();
if (functionName.equals("cast")) {
String castType = ((SQLCastExpr) field.getExpression()).getDataType().getName();
return getCastFunctionReturnType(castType);
} else {
returnType = resolvedType;
}
return returnType;
return resolvedType;
}

public static Schema.Type getCastFunctionReturnType(String castType) {