databrickssql

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Databricks SQL

Translates JSON Schema to Databricks SQL CREATE TABLE statements with DELTA (.sql).

Example

Input (JSON Schema):

{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "integer" }
  }
}

Output (Databricks SQL):

CREATE TABLE users_schema (
  name STRING,
  age BIGINT
)
USING DELTA;

Supported JSON Schema Features

Type Keywords
  • type
  • enum
  • const
Type Values
  • string
  • integer
  • number
  • boolean
  • array
  • object
  • null
Schema Composition
  • allOf
  • anyOf
  • oneOf
  • not
Object Keywords
  • properties
  • required
  • additionalProperties
  • patternProperties
  • propertyNames
  • minProperties / maxProperties
  • unevaluatedProperties
  • dependentRequired
Array Keywords
  • items
  • prefixItems
  • contains
  • minItems / maxItems
  • uniqueItems
  • unevaluatedItems
  • maxContains / minContains
Numeric Validation
  • minimum / maximum
  • exclusiveMinimum / exclusiveMaximum
  • multipleOf
String Validation
  • minLength / maxLength
  • pattern
References & Definitions
  • $ref
  • $defs
  • $id
  • $anchor
  • $dynamicRef / $dynamicAnchor
String Formats
  • date
  • date-time
  • time
  • duration
  • uuid
  • uri / uri-reference / uri-template
  • iri / iri-reference
  • email / idn-email
  • hostname / idn-hostname
  • ipv4 / ipv6
  • json-pointer / relative-json-pointer
  • regex
Annotations
  • description
  • title
  • default
  • deprecated
  • readOnly / writeOnly
  • examples
Conditional
  • if / then / else
  • dependentSchemas
Content
  • contentEncoding
  • contentMediaType
  • contentSchema

Documentation

Overview

Package databrickssql provides Databricks SQL schema translation with DELTA and field comments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Translator

type Translator struct{}

Translator translates JSON schemas to Databricks SQL CREATE TABLE statements.

func (*Translator) FileExtension

func (t *Translator) FileExtension() string

FileExtension returns the file extension for SQL files.

func (*Translator) Translate

func (t *Translator) Translate(portName string, schema *jsonschema.Schema, _ string) ([]byte, error)

Translate converts a JSON schema to a Databricks SQL CREATE TABLE statement with USING DELTA.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL