Giter Site home page Giter Site logo

Comments (2)

dahankzter avatar dahankzter commented on August 24, 2024

Actually it's not that bad when I think about it. A UDT for example looks like this in JSON:

{
      "Name": "col0",
      "Type": {
              "Types": {
                            "udt_672245080_0": "ascii",
                            "udt_672245080_1": "boolean",
                            "udt_672245080_2": "bigint",
                            "udt_672245080_3": "blob"
                },
                "TypeName": "udt_672245080",
                "Frozen": true
          }
}

The UDT field names are ugly simply because they are generated but it is quite clear that it is a complex type. The fact that it is a UDT isn't explicit but a "map" of type names and simple types should be a clue. The generated names hint at it but when hand writing such a file they can of course be called anything.

A tuple looks like:

{
          "Name": "col5",
          "Type": {
                  "Types": [
                            "varchar",
                            "smallint"
                   ],
                   "Frozen": false
          }
}

This is also pretty clear.

What does not seem clear is the index definitions:

{
         "Name": "col0_idx",
         "Column": {
                        "Name": "col0",
                        "Type": {
                            "Types": {
                                "udt_672245080_0": "ascii",
                                "udt_672245080_1": "boolean",
                                "udt_672245080_2": "bigint",
                                "udt_672245080_3": "blob"
                            },
                            "TypeName": "udt_672245080",
                            "Frozen": true
                    }
         }
}

This refers to the column col0 and repeats the type information. This should be omitted and be a simple reference by either column name or column index.

from gemini.

dahankzter avatar dahankzter commented on August 24, 2024

The index definition can look like:

"indexes": [
                {
                    "Name": "col0_idx",
                    "Column": "col0"
                },
                {
                    "Name": "col1_idx",
                    "Column": "col1"
                },
                {
                    "Name": "col2_idx",
                    "Column": "col2"
                },
                {
                    "Name": "col3_idx",
                    "Column": "col3"
                }
            ]

Without affecting functionality but greatly increasing readability.

from gemini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.