carloea2 commented on code in PR #4268:
URL: https://github.com/apache/texera/pull/4268#discussion_r3035948986


##########
frontend/src/app/workspace/types/workflow-compiling.interface.ts:
##########
@@ -70,8 +70,50 @@ export type CompilationStateInfo = Readonly<
       operatorErrors: Readonly<Record<string, WorkflowFatalError>>;
     }
 >;
+
 // possible types of an attribute
-export type AttributeType = "string" | "integer" | "double" | "boolean" | 
"long" | "timestamp" | "binary"; // schema: an array of attribute names and 
types
+// Canonical frontend / JSON schema names
+export type AttributeType =
+  | "string"
+  | "integer"
+  | "long"
+  | "double"
+  | "boolean"
+  | "timestamp"
+  | "binary"
+  | "large_binary";
+
+// Java enum constant names (AttributeType.java)
+export const JAVA_ATTRIBUTE_TYPE_NAMES = [
+  "STRING",
+  "INTEGER",
+  "LONG",
+  "DOUBLE",
+  "BOOLEAN",
+  "TIMESTAMP",
+  "BINARY",
+  "LARGE_BINARY",
+] as const;
+
+export type JavaAttributeTypeName = (typeof JAVA_ATTRIBUTE_TYPE_NAMES)[number];
+
+// Python enum constant names (core.models.AttributeType)
+export const PYTHON_ATTRIBUTE_TYPE_NAMES = [
+  "STRING",
+  "INT",
+  "LONG",
+  "DOUBLE",
+  "BOOL",
+  "TIMESTAMP",
+  "BINARY",
+  "LARGE_BINARY",
+] as const;
+
+export type PythonAttributeTypeName = (typeof 
PYTHON_ATTRIBUTE_TYPE_NAMES)[number];
+
+// Useful when parsing code from either side
+export type AttributeTypeToken = AttributeType | JavaAttributeTypeName | 
PythonAttributeTypeName;

Review Comment:
   It is because Python names and Java names for attributes are not the same 
for all, such as Int and Integer



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to