Code Monkey home page Code Monkey logo

protobufkdb's People

Contributors

cmccarthy1 avatar mshimizu-kx avatar nmcdonnell-kx avatar sshanks-kx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

protobufkdb's Issues

Cannot serialise message where all fields have the same type

If a protobuf schema only contains fields of the same type, e.g.:

message Basic {
    int32 first = 1;
    int32 second = 2;
}

you cannot create the necessary two -KI atom mixed list in q to satifisy the message type checking since q will convert it to a KI simple list:

q)type (1i;2i)
6h

Solution is to allow general nulls (::) to be present in the message's mixed list to prevent the conversion:

q)type (1i;2i;::)
0h

Any fields set to :: should be ignored. Also the type checking on incorrect number of message fields need to be loosened, only throwing an error is the mixed list length is less that the number of fields in the message.

Can we run this on Rhel6 machines?

In attempt to run the package in rhel6 I am getting an error
usr/lib64/libstdc++.so.6 version GLIBCXX_3.4.18 not found required by protobufkdb.so
The above version of package isnt available for rhel6 machines.

Invalid message field values error on presumably correct values

I'm trying to use protobufkdb to parse the following schema:

.protobufkdb.addProtoImportPath["proto/mark/v1"];
.protobufkdb.importProtoFile["mark.proto"];
.protobufkdb.displayMessageSchema[`model.mark.v1.Mark]
message Mark {
  double latpoint = 1;
  double longpoint = 2;
}
.protobufkdb.serializeArrayFromDict[`model.mark.v1.Mark;`latpoint`longpoint!(100f;100f)]

evaluation error:

Invalid message field values, descriptor: 'model.mark.v1.Mark', expected: 0, received: 9

[0] .protobufkdb.serializeArrayFromDict[model.mark.v1.Mark;latpoint`longpoint!(100f;100f)]

   ^

Furthermore, I recieve the same result from a list:
.protobufkdb.serializeArrayFromList[model.mark.v1.Mark;(100f;100f)]`

Invalid message field values, descriptor: 'model.mark.v1.Mark', expected: 0, received: 9

[0] .protobufkdb.serializeArrayFromDict[`model.mark.v1.Mark;(100f;100f)]

   ^

using:

  • ubuntu:18.04
  • libprotoc 3.0.0
  • built from source with cmake as detailed in docs
  • KDB 64bit edition
  • protobufkdb version 3014000i

Could someone advise me on how to fix this?
Thanks

32bit compatibility?

Would there be anything impeding the use of protobufkdb with the 32bit version of kdb?

Allow alternative proto message representation as kdb dictionaries from field names to field values

Currently protobufkdb represents a proto message in kdb as a mixed lists of field values in field positional order. This is for performance reasons and to more closely tie in with how protobuf serialises messages.

However, some users may prefer messages to use a dictionary from symbol field names to a mixed list of field values, more similar to how JSON is represented. In this case each field would be looked up by its name so the positional order is no longer required.

Both styles should be supported by separate APIs. So for each of the serialisation and parsing functions both the mixed list and dictionary versions are exposed, e.g.:

serializeArray
becomes
serializeArrayFromList
serializeArrayFromDict

and:

parseArray
becomes
parseArrayToList
parseArrayToDict

Note the dictionary versions need to work recursively on sub-messages or maps to messages. To help with using the dictionary version, it would be helpful to have a function which returns a symbol list of the field names for the specified proto message schema.

Dynamic importing problems

  • importProtoFile does not clear the errors list between calls
  • Errors returned by importProtoFile are formatted differently to the same errors when generated by protoc
  • When installing the packaged version of protobufkdb, not all of Google's .proto files are available

Change string and bytes proto field mapping

Currently these are all represented as symbols. This should be changed on the parsing path to use kdb char array and byte array as follows:

Proto message field type Kdb Type
Scalar string 10h (char array)
Scalar bytes 4h (byte array)
Repeated string Mixed list of 10h
Repeated bytes Mixed list of 4h
Map key string 11h (symbol list) for dictionary key

On the serialisation path is should be possible to use any of -11|4|10h interchangeably and protobufkdb will convert it under the covers. However, it is recognised that one disadvantage of this flexible approach is that you lose the round trip reflective behaviour โ€“ so while for serialising a proto string you could use any of -11|4|10h, on parsing you'll always get a 10h back.

Docs should be included with release

New docs folder wont currently be added to a release build - should be included in the future while docs are there.
.travis.yml example area
e.g.
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
7z a -tzip $FILE_NAME README.md install.bat LICENSE q examples;
elif [[ $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ]]; then
tar -zcvf $FILE_NAME README.md install.sh LICENSE q examples;

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.