zed icon indicating copy to clipboard operation
zed copied to clipboard

YAML format support

Open 1nhann opened this issue 1 year ago • 1 comments

SuperDB should support YAML as an input/output format.

Details

At the time this issue is being opened, super is at commit 222ded6.

Since SuperDB does not currently support YAML, tools like yq are helpful for converting to intermediate formats to make this data available in pipelines. For instance, given this example YAML in file k8s.yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi  # Request 1 Gigabyte of storage

We can turn it into JSON for ultimate processing by super via:

$ super -version
Version: v1.18.0-159-g222ded63

$ yq -o json k8s.yaml | super -Z -
{
    apiVersion: "v1",
    kind: "PersistentVolumeClaim",
    metadata: {
        name: "my-pvc"
    },
    spec: {
        accessModes: [
            "ReadWriteOnce"
        ],
        resources: {
            requests: {
                storage: "1Gi"
            }
        }
    }
}

Likewise, using JSON output as an intermediate step before using yq to turn it into YAML:

$ super -j -c 'yield {hello: "world", a:[1,2,3]}' | yq -P -oy -

hello: world
a:
  - 1
  - 2
  - 3

For initial native YAML support, a community contribution was made in #5483, but the core Dev team has declined to merge it into the project for now (more details in that PR). We'll hold this issue open to continue collect community interest to establish priority and will plan to add YAML support in the future.

1nhann avatar Nov 15 '24 09:11 1nhann

this is my request : https://github.com/brimdata/super/pull/5483

1nhann avatar Nov 15 '24 09:11 1nhann