sshiv012 opened a new pull request, #8644:
URL: https://github.com/apache/texera/pull/8644
### What changes were proposed in this PR?
Delimiter properties were plain text boxes. A stored tab looked empty,
typing `\t` stopped at the backslash, and Unnest String accepted invalid or
degenerate regexes without a word. This replaces them with a **delimiter
picker**: common delimiters by name, plus a **Custom…** entry. Each operator
picks a mode through a schema hint (`@JsonSchemaInject(json =
UIWidget.UIWidgetCharDelimiter / UIWidgetRegexDelimiter)`).
```
CSV scans (char) Comma Tab Semicolon Pipe Space | Custom…
(1 char; typed \t -> tab)
Unnest String (regex) Comma Tab Semicolon Pipe (\|) Whitespace (\s+)
New line | Custom regex… (validated)
```
| Area | Change |
|---|---|
| Frontend | New formly type `delimiter`
(`frontend/src/app/common/formly/delimiter/`). Works in the canvas property
panel and the Form View. Delimiter errors show immediately, including for
invalid values loaded from a saved workflow. |
| Regex check (browser) | Must compile, must not match the empty string
(`\|`, `\s*`), must not match every character (`.`). The last is **exact**: it
tests every BMP character other than line breaks, stopping at the first miss,
so `[a0-]` or `[^,]` pass. Patterns using Java-only syntax (inline flags,
possessive quantifiers, `\p{..}`, `\x{..}`, `\Q..\E`, `\e`, `\h`, `\z`, …) are
left to the backend, because JavaScript can't parse them or reads them
differently. |
| Regex check (backend) | `UnnestStringOpDesc` makes the same checks with
Java's engine during schema propagation, so a bad pattern is a **compile
error** instead of a runtime `PatternSyntaxException` or an empty result. |
| CSV scans | `CSVFileScan`, `ParallelCSVFileScan`, `CSVOldFileScan` use the
char-mode widget. `maxLength: 1` is kept. |
**Saved workflows:** the stored value is still the delimiter itself, so
existing workflows load unchanged and a stored tab shows as "Tab".
**One intentional behavior change:** a saved Unnest String delimiter that
matches the empty string or every character (e.g. `|`, `.`) now fails to
compile. Previously it ran and silently split every character apart, or output
only line breaks.
#### Before / after
<!-- drag comparison/C1-csv-stored-tab.png here -->
<!-- drag comparison/C2-csv-typing-tab.png here -->
<!-- drag comparison/C3-csv-choices.png here -->
<!-- drag comparison/C4-csv-legacy-value.png here -->
<!-- drag comparison/C5-unnest-choices.png here -->
<!-- drag comparison/C6-unnest-pipe.png here -->
<!-- drag comparison/C7-unnest-dot.png here -->
<!-- drag comparison/C8-unnest-invalid.png here -->
<!-- drag comparison/C9-unnest-compile.png here -->
_Screenshots C1–C9: to be attached._
### Any related issues, documentation, discussions?
Closes #8638
### How was this PR tested?
**Automated.** Tests were written first and seen failing, then made to pass.
| Suite | Result |
|---|---|
| Frontend, full (`ng test`) | 232 files, 6,376 passed |
| Delimiter / formly specs (included above) | presets for both modes,
custom-regex validation (valid, invalid, empty-match, every-character,
Java-only syntax), edge cases, and a rendered test that feeds the backend's
exact schema through formly-jsonschema |
| `WorkflowOperator/test`, full | 2,602 passed |
| New backend specs | each CSV preset read by all three CSV readers; Unnest
String split with every regex preset and custom patterns; compile-time
rejection with Java semantics |
| Lint / format / types / build | eslint, prettier-eslint, `tsc`, `ng
build`, scalafmt: clean |
**Manual, in the browser.** Local stack (`bin/local-dev.sh up`), Chrome
driven by Playwright, 1600×1000:
1. Open a workflow with CSV File Scan and Unnest String, click each
operator, and open the Delimiter picker.
2. Pick each preset; choose Custom… and type `#`, `\t`, `ab`.
3. For Unnest String, choose Custom regex… and type `[,;]\s*`, `(`, `[a-`,
`a{2,1}`, `|`, `\s*`, `.`, `\.`, `,++`, then clear the field.
4. Type `(?i)(` and `(?s).`: the browser leaves them to the backend, and the
Result Panel shows the compile error.
All 33 scripted checks pass. The before/after screenshots above come from
this run and from the same flow on the base commit.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]