H2oApi Java bindings columns endpoint not returning column metadata

我的未来我决定 提交于 2019-12-12 04:11:53

问题


We are developing a Java programm with H2O 3.10.4.7 and we need to retrieve metadata about all columns in a frame such as column names and datatypes. Related question (not resolved, different problem) here.

Our expectation was that the water.bindings.H2oApi Client works just like the REST endpoints and we wanted to use the the H2oApi method frameColumns(FrameKeyV3 frameId) described in Javadoc:

"Return all the columns from a Frame."

but the result does not include any column-related info. When we use the REST endpoint via Browser, we get detailed information about the columns in the frame like expected. Examples:

H2oApi:

FramesV3 params = new FramesV3();
params.frameId = stringToKey(frame, FrameKeyV3.class); // "frame" reference from import process, works

// try with frameColumns()
FramesV3 frameColumns = api.frameColumns(params);
System.out.println(frameColumns.toString()); // "columns" not included in JSON response

Result:

{
   "column":"",
   "row_offset":0,
   "row_count":0,
   "column_offset":0,
   "column_count":0,
   "find_compatible_models":false,
   "path":"",
   "force":false,
   "num_parts":1,
   "frames":[
      {
         "frame_id":{
            "name":"3d257aae-7266-48a1-8f35-1243436616ab",
            "type":"Key\u003cFrame\u003e",
            "URL":"/3/Frames/3d257aae-7266-48a1-8f35-1243436616ab"
         },
         "byte_size":1928,
         "is_text":false,
         "_exclude_fields":""
      }
   ],
   "_exclude_fields":""
}

REST endpoint:

http://localhost:54321/3/Frames/3d257aae-7266-48a1-8f35-1243436616ab/columns

Result:

{

    "__meta": {
        "schema_version": 3,
        "schema_name": "FramesV3",
        "schema_type": "Frames"
    },
    "_exclude_fields": "",
    "row_offset": 0,
    "row_count": 0,
    "column_offset": 0,
    "column_count": 0,
    "job": null,
    "frames": [
        {
            "__meta": {
                "schema_version": 3,
                "schema_name": "FrameV3",
                "schema_type": "Frame"
            },
            "_exclude_fields": "",
            "frame_id": {
                "__meta": {
                    "schema_version": 3,
                    "schema_name": "FrameKeyV3",
                    "schema_type": "Key<Frame>"
                },
                "name": "3d257aae-7266-48a1-8f35-1243436616ab",
                "type": "Key<Frame>",
                "URL": "/3/Frames/3d257aae-7266-48a1-8f35-1243436616ab"
            },
            "byte_size": 1928,
            "is_text": false,
            "row_offset": 0,
            "row_count": 100,
            "column_offset": 0,
            "column_count": 5,
            "total_column_count": 5,
            "checksum": -7731554748204616990,
            "rows": 150,
            "num_columns": 5,
            "default_percentiles": [
                0.001,
                0.01,
                0.1,
                0.2,
                0.25,
                0.3,
                0.3333333333333333,
                0.4,
                0.5,
                0.6,
                0.6666666666666666,
                0.7,
                0.75,
                0.8,
                0.9,
                0.99,
                0.999
            ],
            "columns": [
                {
                    "__meta": {
                        "schema_version": 3,
                        "schema_name": "ColV3",
                        "schema_type": "Vec"
                    },
                    "label": "sepal_length",
                    "missing_count": 0,
                    "zero_count": 0,
                    "positive_infinity_count": 0,
                    "negative_infinity_count": 0,
                    "mins": [
                        4.3,
                        4.4,
                        4.4,
                        4.4,
                        4.5
                    ],
                    "maxs": [
                        7.9,
                        7.7,
                        7.7,
                        7.7,
                        7.7
                    ],
                    "mean": 5.843333333333334,
                    "sigma": 0.8280661279778637,
                    "type": "real",
                    "domain": null,
                    "domain_cardinality": 0,
                    "data": [ ... ]
            "string_data": null,
            "precision": 1,
            "histogram_bins": null,
            "histogram_base": 0.0,
            "histogram_stride": 0.0,?
            "percentiles": null
    ...
}

We are interested in the JSON entity "columns" to retrieve the metadata we need but it is not provided by the H2o Java Api.

Best regards!

Nico


回答1:


As mentioned in the comments - this seems to be a bug relating to how we are using Retrofit, please create an issue in our JIRA. You can point to this Retrofit issue in it. To be sure also please post the JIRA link on H2O-3 gitter channel.



来源:https://stackoverflow.com/questions/44259044/h2oapi-java-bindings-columns-endpoint-not-returning-column-metadata

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!