Commit 2320318
committed
fix: make ExtDestGeCopy EXECUTE clause sh-compatible
The EXECUTE clause for CREATE EXTERNAL WEB TABLE in the ExtDestGeCopy
strategy used bash-specific array syntax (`SEGMENTS=(...)` and
`"${SEGMENTS[@]}"`) to determine if a segment should run cbcopy_helper.
This caused a `sh: 1: Syntax error: "(" unexpected` error when the
database, which often uses `sh`, tried to execute the command.
This commit refactors the shell script within the EXECUTE clause:
- Replaces bash array initialization with a space-separated string
variable `SRC_SEG_IDS_STR`.
- Uses a `sh`-compatible `for` loop to iterate over `SRC_SEG_IDS_STR`.
- Employs standard string comparison `[ "$cur_id" = "$GP_SEGMENT_ID" ]`
to check for matching segment IDs.
This change ensures the external table command is compatible with `sh`
and prevents the previously observed syntax error, allowing data copy
to proceed correctly when the ExtDestGeCopy strategy is used.1 parent 7005ef2 commit 2320318
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
0 commit comments