dongjoon-hyun commented on a change in pull request #941: URL: https://github.com/apache/orc/pull/941#discussion_r732459997
########## File path: java/tools/src/test/org/apache/orc/tools/TestFileDump.java ########## @@ -703,4 +709,86 @@ public void testHasNull() throws Exception { assumeTrue(!System.getProperty("os.name").startsWith("Windows")); TestFileDump.checkOutput(outputFilename, workDir + File.separator + outputFilename); } + + @Test + public void testRecover() throws Exception { + TypeDescription schema = getMyRecordType(); + conf.set(OrcConf.ENCODING_STRATEGY.getAttribute(), "COMPRESSION"); + conf.set(OrcConf.DICTIONARY_IMPL.getAttribute(), "rbtree"); + Writer writer = OrcFile.createWriter(testFilePath, + OrcFile.writerOptions(conf) + .fileSystem(fs) + .setSchema(schema) + .compress(CompressionKind.ZLIB) + .stripeSize(100000) + .rowIndexStride(1000)); + Random r1 = new Random(1); + String[] words = new String[]{"It", "was", "the", "best", "of", "times,", + "it", "was", "the", "worst", "of", "times,", "it", "was", "the", "age", + "of", "wisdom,", "it", "was", "the", "age", "of", "foolishness,", "it", + "was", "the", "epoch", "of", "belief,", "it", "was", "the", "epoch", + "of", "incredulity,", "it", "was", "the", "season", "of", "Light,", + "it", "was", "the", "season", "of", "Darkness,", "it", "was", "the", + "spring", "of", "hope,", "it", "was", "the", "winter", "of", "despair,", + "we", "had", "everything", "before", "us,", "we", "had", "nothing", + "before", "us,", "we", "were", "all", "going", "direct", "to", + "Heaven,", "we", "were", "all", "going", "direct", "the", "other", + "way"}; + VectorizedRowBatch batch = schema.createRowBatch(1000); + for(int i=0; i < 21000; ++i) { + appendMyRecord(batch, r1.nextInt(), r1.nextLong(), + words[r1.nextInt(words.length)]); + if (batch.size == batch.getMaxSize()) { + writer.addRowBatch(batch); + batch.reset(); + } + } + if (batch.size > 0) { + writer.addRowBatch(batch); + } + writer.addUserMetadata("hive.acid.key.index", Review comment: If you don't mind, shall we remove this? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@orc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org