apache-hive-1.1.0-src/metastore/if/hive_metastore.thrift
このThriftファイル内の以下の定義に対して--gen go
ではErrorとなる。
// this object holds all the information about skewed table
struct SkewedInfo {
1: list<string> skewedColNames, // skewed column names
2: list<list<string>> skewedColValues, //skewed values
3: map<list<string>, string> skewedColValueLocationMaps, //skewed value to location mappings
}
Error messageは次の通り。
Error: Cannot produce a valid type for a Go map key: []string - aborting.
つまり、GolangではMapのkeyに[]string
をとれませんよーということ。
理由はこちら。 http://golang.org/ref/spec#Map_types
The comparison operators == and != must be fully defined for operands of the key type; thus the key type must not be a function, map, or slice. If the key type is an interface type, these comparison operators must be defined for the dynamic key values; failure will cause a run-time panic.
参考JIRA ticket. https://issues.apache.org/jira/browse/THRIFT-2063
結局はhive_metastore.thriftの対象の構造を変更するか、上記ticketでthrift golangの変換をうまくやってもらうしかないのだろうか。