Created
December 12, 2016 14:37
-
-
Save l15k4/e566ffdaa45fb9681f3183ba0429c18e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val writer = new ParquetWriter[Group](outFile, new GroupWriteSupport, codec, blockSize, pageSize, dictPageSize, true, true, ParquetProperties.WriterVersion.PARQUET_2_0, configuration) | |
try { | |
records.foreach { case ClientRecord(cid, diid, gwid, dvc, geo, timestamp, kvs) => | |
val group = new SimpleGroup(schema) | |
.append("timestamp", timestamp) | |
.append("cid", cid) | |
.append("diid", diid) | |
.append("gwid", gwid) | |
.append("dvc", dvc) | |
.append("geo", geo) | |
val kvsGroup = group.addGroup("kvs") | |
kvs.foreach { case (k,v) => | |
kvsGroup | |
.addGroup("kv") | |
.append("key",k) | |
.append("value",v) | |
} | |
writer.write(group) | |
} | |
} finally writer.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment