sql icon indicating copy to clipboard operation
sql copied to clipboard

(Calcite PPL) `spath` command dynamic columns support

Open ykmr1224 opened this issue 3 months ago • 1 comments

Support dynamic columns use case with spath PPL command.

Example: following spath command will parse doc attribute and extract all the attributes as columns.

source=idx
| spath input=doc

Each item could be any type since JSON attribute could be string/number/array/null

ykmr1224 avatar Sep 16 '25 21:09 ykmr1224

source=idx | spath input=doc

@ykmr1224 if we add change requirement of spath as

  • input: mandatory. The field to scan for JSON data.
  • output: The destination field that the data will be loaded to. Default: value of path.
    • optional, if path exist.
    • mandatory, if path does not exist.
  • path: The path of the data to load for the object.
    • optional if output exist.
    • mandatory if output does not exist.

then PPL does not need to support dynamic columns. does it sounds as workaround?

penghuo avatar Dec 12 '25 21:12 penghuo