Copilot commented on code in PR #6288:
URL: https://github.com/apache/texera/pull/6288#discussion_r3554495945
##########
frontend/src/app/workspace/component/result-panel/error-frame/error-frame.component.ts:
##########
@@ -72,11 +72,36 @@ export class ErrorFrameComponent implements OnInit {
errorMessages = errorMessages.filter(err => err.operatorId ===
this.operatorId);
}
this.categoryToErrorMapping = errorMessages.reduce((acc, obj) => {
- const key = obj.type.name;
+ let key = obj.type.name;
+ let message = obj.message;
+ let details = obj.details;
+
+ if (key === "COMPILATION_ERROR") {
+ // Strip out common Java exception class names and formatting to make
it more user-friendly
+ const exceptionRegex =
/^\s*(?:(?:[a-zA-Z0-9_]+\.)*[a-zA-Z0-9_]+(?:Exception|Error)):\s*/;
+ const requirementFailedRegex = /^\s*requirement failed:\s*/;
+
Review Comment:
The regex-based stripping is only applied when type is COMPILATION_ERROR,
but the PR description calls this out as a global catch-all; runtime errors are
FatalErrorType.EXECUTION_FAILURE as well and will still show raw exception
prefixes.
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/csv/CSVScanSourceOpDesc.scala:
##########
@@ -78,10 +78,22 @@ class CSVScanSourceOpDesc extends ScanSourceOpDesc {
}
override def sourceSchema(): Schema = {
- if (customDelimiter.isEmpty || !fileResolved()) {
- return null
+ if (customDelimiter.forall(_.isEmpty)) {
+ customDelimiter = Option(",")
+ }
Review Comment:
sourceSchema() mutates customDelimiter to fill defaults; this adds side
effects during schema inference/compilation and duplicates the defaulting
already done in getPhysicalOp(). A local derived delimiter avoids mutating
operator state.
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/csvOld/CSVOldScanSourceOpDesc.scala:
##########
@@ -75,11 +75,22 @@ class CSVOldScanSourceOpDesc extends ScanSourceOpDesc {
}
override def sourceSchema(): Schema = {
- if (customDelimiter.isEmpty || !fileResolved()) {
- return null
+ if (customDelimiter.forall(_.isEmpty)) {
+ customDelimiter = Option(",")
+ }
Review Comment:
sourceSchema() mutates customDelimiter to fill defaults; this adds side
effects during schema inference/compilation. Even though CSVOld initializes a
default delimiter, deriving a local delimiter char avoids mutating descriptor
state here.
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/csv/ParallelCSVScanSourceOpDesc.scala:
##########
@@ -79,10 +79,22 @@ class ParallelCSVScanSourceOpDesc extends ScanSourceOpDesc {
}
override def sourceSchema(): Schema = {
- if (customDelimiter.isEmpty || !fileResolved()) {
- return null
+ if (customDelimiter.forall(_.isEmpty)) {
+ customDelimiter = Option(",")
+ }
Review Comment:
sourceSchema() mutates customDelimiter to fill defaults; this adds side
effects during schema inference/compilation and duplicates the defaulting
already done in getPhysicalOp(). Consider deriving a local delimiter (char)
instead of mutating the descriptor.
--
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]