Hello!

I'm currently writing an importer to import our MySQL data into hadoop ( as Avro files ). Attached you can find the schema i'm converting to Avro, along with the corresponding Avro schema i would like to use for my imported data. I was wondering if you guys could go over the schema and determine if this is sane/optimal, and if not, how i should improve it.

As a sidenote, i converted bigints to long, and had 1 occurrence of double, which i also converted to long in the avro, not sure if that's the correct type?

Thanks in advance for your expert opinions! ;)

Kind regards,

Bart
{
        "type": "record",
        "name": "fmssession",
        "namespace": "asp",
        "fields": [
                {   "name": "id"   , "type": "long"   },
                {   "name": "terminalid"   , "type": "int"   },
                {   "name": "starttime"   , "type": "long"   },
                {   "name": "duration"   , "type": "long"   },
                {   "name": "endtime"   , "type": "long"   },
                {   "name": "driverid"   , "type": "string"   },
                {   "name": "startmileage"   , "type": "int"   },
                {   "name": "endmileage"   , "type": "int"   },
                {   "name": "distance"   , "type": "int"   },
                {   "name": "fmsbarvalues", "type": {
                                "type": "array",
                                "items": {
                                        "name": "fmsbarvalue",
                                        "type": "record",
                                        "fields": [
                                                {       "name": "id", "type": 
"long"    },
                                                {       "name": "type", "type": 
"string"        },
                                                {       "name": "total", 
"type": "int"  },
                                                {       "name": "fmsbarlines",
                                                        "type": {
                                                                "type": "array",
                                                                "items": {
                                                                        "name": 
"fmsbarline",
                                                                        "type": 
"record",
                                                                        
"fields": [
                                                                                
{       "name": "id", "type": "long"    },
                                                                                
{       "name": "type", "type": "string"        },
                                                                                
{       "name": "total", "type": "int"  }
                                                                        ]
                                                                }
                                                        }
                                                }
                                        ]
                                }
                        }
                },
                {   "name": "fmssinglevalues", "type": {
                                "type": "array",
                                "items": {
                                        "name": "fmssinglevalue",
                                        "type": "record",
                                        "fields": [
                                                {       "name": "id", "type": 
"long"    },
                                                {       "name": "value", 
"type": "long" },
                                                {       "name": "type", "type": 
"string"        }
                                        ]
                                }
                        }
                },
                {   "name": "fmsswitchvalues", "type": {
                                "type": "array",
                                "items": {
                                        "name": "fmsswitchvalue",
                                        "type": "record",
                                        "fields": [
                                                {       "name": "id", "type": 
"long"    },
                                                {       "name": "type", "type": 
"string"        },
                                                {       "name": 
"activationcount", "type": "int"        },
                                                {       "name": "durationon", 
"type": "long"    },
                                                {       "name": "durationoff", 
"type": "long"   },
                                                {       "name": "distanceon", 
"type": "int"     },
                                                {       "name": "distanceoff", 
"type": "int"    },
                                        ]
                                }
                        }
                } 
        ]
}

<<attachment: fms-mysql-schema.png>>

Reply via email to