Code Monkey home page Code Monkey logo

bottledwater-pg's People

Contributors

a1exsh avatar badboyd avatar bchazalet avatar buzila avatar ept avatar fearofcode avatar gonzalo-bulnes avatar hieutrtr avatar juliaaano avatar kinghuang avatar mcapitanio avatar samstokes avatar tkaemming avatar tkothe avatar

Watchers

 avatar  avatar  avatar  avatar

bottledwater-pg's Issues

Don't set --schema-registry option based on presence of schema-registry service

The bottledwater-docker-wrapper.sh entrypoint script sets the --schema-registry option if it is able to find a host entry for schema-registry. This makes it impossible to use the json output format if a Schema Registry service is reachable, because Bottled Water exits with the following message.

Specifying --schema-registry doesn't make sense for --output-format=json

Add option to generate “flat” message keys

Bottled Water generates Kafka message keys as a dict based on the table row primary key. This is inconvenient when using the resulting stream with some Kafka Streams operations, because dict comparisons for the same key can come out as false.

Provide an option for emitting the value of the primary key as the message key, instead of wrapping it in a dict. Here's an example, expressed in JSON.

Current message key:

{
  "id": {
    "long": 12345
  }
}

Flat message key:

12345

Add option to output ISO 8601 format datetimes

Bottled Water outputs datetimes as a dict of datetime components like the following.

"created": {
  "DateTime": {
    "year": "2017",
    "month": "03",
    "date": "14",
    "hour": "15",
    "minute": "42",
    "second": "49",
    "micro": "230990"
  }
}

It would be handy to have an option to output an ISO 8601 combined date and time format instead.

2017-03-14T15:42:49.230990

Add option to generate “flat” column/attribute values

The json output format in Bottled Water is a literal json representation of an Avro formatted message. This can be highly inconvenient to parse. Here is an example of the current output.

{
  "id": {
    "long": 3688267
  },
  "language": {
    "string": "en_US"
  },
  "created": {
    "DateTime": {
      "year": "2017",
      "month": "03",
      "date": "14",
      "hour": "15",
      "minute": "42",
      "second": "49",
      "micro": "230990"
    }
  }
}

In the example, the value of each attribute (id, language, and created) is a dict with one item whose key is the value type, and value is the actual value. This requires readers to either know ahead of time what the value type of each attribute is in order to get the underlying value, or infer the value key by iterating or searching over the dict.

It would be convenient if there is an option to directly emit the value of each attribute, like the following.

{
  "id": 3688267,
  "language": "en_US",
  "created": {
    "year": "2017",
    "month": "03",
    "date": "14",
    "hour": "15",
    "minute": "42",
    "second": "49",
    "micro": "230990"
  }
}

Or, if it is desirable to preserve the type information, organize it as a list/array/tuple, so that it is easy to get the type and underlying value without needing fore-knowledge or potentially expensive operations over dict.

{
  "id": ["long", 3688267],
  "language": ["string", "en_US"],
  "created": ["DateTime", {
    "year": "2017",
    "month": "03",
    "date": "14",
    "hour": "15",
    "minute": "42",
    "second": "49",
    "micro": "230990"
  }]
}

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.