id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
19317653_48 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testUpdate() {\n\t\tDBCollection coll = createMockCollection();\n\t\tDBCursor cursor = createMockCursor();\n\t\tDBObject query = new BasicDBObject(\"_id\", new ObjectId(\"aaaaaaaaaaaaaaaaaaaaaaa2\"));\n\t\tDBObject dbObj = new BasicDBObject();\n\t\tdbObj.put(\"_id\", new ObjectId(\"aaa... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public ToDo update(String id, ToDo td) {\n DBObject query = new BasicDBObject(\"_id\", new ObjectId(id));\n DBObject update = convertToDbObject(td);\n coll.update(query, update);\n DBCursor cursor = coll.find(query);\n ToDo newTd = createToDo(cursor.next());\n cursor.close();... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_33 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantReducedRowTest.java",
"identifier": "CloudantReducedRowTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetValue() {\n CloudantReducedRow row = new CloudantReducedRow();\n row.setValue(123);\n assertEquals(123, row.getValue());\n }",
"class_method_signature": "CloudantReducedRowTest.testGetValue()",
"constructor": false,
"full_signature": "@Test public void testGetVal... | {
"fields": [
{
"declarator": "key",
"modifier": "private",
"original_string": "private String key;",
"type": "String",
"var_name": "key"
},
{
"declarator": "value",
"modifier": "private",
"original_string": "private int value;",
"type": "int",
"... | {
"body": "public int getValue() {\n return value;\n }",
"class_method_signature": "CloudantReducedRow.getValue()",
"constructor": false,
"full_signature": "public int getValue()",
"identifier": "getValue",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_25 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantPostResponseTest.java",
"identifier": "CloudantPostResponseTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsOk() {\n CloudantPostResponse resp = new CloudantPostResponse();\n resp.setOk(false);\n assertFalse(resp.isOk());\n resp.setOk(true);\n assertTrue(resp.isOk());\n }",
"class_method_signature": "CloudantPostResponseTest.testIsOk()",
"constructor": false,
"ful... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "ok",
"modifier": "private",
"original_string": "private boolean ok;",
"type": "boolean",
"v... | {
"body": "public boolean isOk() {\n return ok;\n }",
"class_method_signature": "CloudantPostResponse.isOk()",
"constructor": false,
"full_signature": "public boolean isOk()",
"identifier": "isOk",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "b... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
158256479_184 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/serde/objectinspector/TestIcebergDecimalObjectInspector.java",
"identifier": "TestIcebergDecimalObjectInspector",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCache() {\n HiveDecimalObjectInspector oi = IcebergDecimalObjectInspector.get(38, 18);\n\n Assert.assertSame(oi, IcebergDecimalObjectInspector.get(38, 18));\n Assert.assertNotSame(oi, IcebergDecimalObjectInspector.get(28, 18));\n Assert.assertNotSame(oi, IcebergDecimalO... | {
"fields": [
{
"declarator": "CACHE = Caffeine.newBuilder()\n .expireAfterAccess(10, TimeUnit.MINUTES)\n .build()",
"modifier": "private static final",
"original_string": "private static final Cache<Integer, IcebergDecimalObjectInspector> CACHE = Caffeine.newBuilder()\n ... | {
"body": "public static IcebergDecimalObjectInspector get(int precision, int scale) {\n Preconditions.checkArgument(scale < precision);\n Preconditions.checkArgument(precision <= HiveDecimal.MAX_PRECISION);\n Preconditions.checkArgument(scale <= HiveDecimal.MAX_SCALE);\n\n Integer key = precision << 8 | ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_147 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testManifestEntryFieldIdsForChangedPartitionSpecForV1Table() {\n table.newAppend()\n .appendFile(FILE_A)\n .commit();\n\n Snapshot snap = table.currentSnapshot();\n long commitId = snap.snapshotId();\n validateSnapshot(null, snap, 1, FILE_A);\n TableMetadat... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_30 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testZeroRecordFile() {\n DataFile empty = new TestDataFile(\"file.parquet\", Row.of(), 0);\n\n Expression[] exprs = new Expression[] {\n lessThan(\"id\", 5), lessThanOrEqual(\"id\", 30), equal(\"id\", 70), greaterThan(\"id\", 78),\n greaterThanOrEqual(\"id\", 90), n... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_9 | {
"fields": [
{
"declarator": "SUPPORTED_PRIMITIVES = Types.StructType.of(\n optional(1, \"intCol\", Types.IntegerType.get()),\n optional(3, \"longCol\", Types.LongType.get()),\n optional(6, \"intCol2\", Types.IntegerType.get()),\n optional(20, \"intCol3\", Types.IntegerType.get()),\n ... | {
"body": "@Test\n public void testRoundtripConversionPrimitive() {\n TypeDescription orcSchema = ORCSchemaUtil.convert(new Schema(SUPPORTED_PRIMITIVES.fields()));\n assertEquals(SUPPORTED_PRIMITIVES, ORCSchemaUtil.convert(orcSchema).asStruct());\n }",
"class_method_signature": "TestORCSchemaUtil.testRoundt... | {
"fields": [
{
"declarator": "ICEBERG_ID_ATTRIBUTE = \"iceberg.id\"",
"modifier": "static final",
"original_string": "static final String ICEBERG_ID_ATTRIBUTE = \"iceberg.id\";",
"type": "String",
"var_name": "ICEBERG_ID_ATTRIBUTE"
},
{
"declarator": "ICEBERG_REQUIRED_... | {
"body": "public static TypeDescription convert(Schema schema) {\n final TypeDescription root = TypeDescription.createStruct();\n final Types.StructType schemaRoot = schema.asStruct();\n for (Types.NestedField field : schemaRoot.asStructType().fields()) {\n TypeDescription orcColumType = convert(field.... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_88 | {
"fields": [],
"file": "api/src/test/java/org/apache/iceberg/catalog/TestTableIdentifier.java",
"identifier": "TestTableIdentifier",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToLowerCase() {\n Assert.assertEquals(\n TableIdentifier.of(\"Tbl\").toLowerCase(),\n TableIdentifier.of(\"tbl\"));\n Assert.assertEquals(\n TableIdentifier.of(\"dB\", \"TBL\").toLowerCase(),\n TableIdentifier.of(\"db\", \"tbl\"));\n Assert.asse... | {
"fields": [
{
"declarator": "DOT = Splitter.on('.')",
"modifier": "private static final",
"original_string": "private static final Splitter DOT = Splitter.on('.');",
"type": "Splitter",
"var_name": "DOT"
},
{
"declarator": "namespace",
"modifier": "private final... | {
"body": "public TableIdentifier toLowerCase() {\n String[] newLevels = Arrays.stream(namespace().levels())\n .map(String::toLowerCase)\n .toArray(String[]::new);\n String newName = name().toLowerCase();\n return TableIdentifier.of(Namespace.of(newLevels), newName);\n }",
"class_method_sign... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_110 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestPartitionSpecParser.java",
"identifier": "TestPartitionSpecParser",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testToJsonForV1Table() {\n String expected = \"{\\n\" +\n \" \\\"spec-id\\\" : 0,\\n\" +\n \" \\\"fields\\\" : [ {\\n\" +\n \" \\\"name\\\" : \\\"data_bucket\\\",\\n\" +\n \" \\\"transform\\\" : \\\"bucket[16]\\\",\\n\" +\n \" \\\"source... | {
"fields": [
{
"declarator": "SPEC_ID = \"spec-id\"",
"modifier": "private static final",
"original_string": "private static final String SPEC_ID = \"spec-id\";",
"type": "String",
"var_name": "SPEC_ID"
},
{
"declarator": "FIELDS = \"fields\"",
"modifier": "priva... | {
"body": "public static void toJson(PartitionSpec spec, JsonGenerator generator) throws IOException {\n generator.writeStartObject();\n generator.writeNumberField(SPEC_ID, spec.specId());\n generator.writeFieldName(FIELDS);\n toJsonFields(spec, generator);\n generator.writeEndObject();\n }",
"class... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_67 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testMissingColumn() {\n AssertHelpers.assertThrows(\"Should complain about missing column in expression\",\n ValidationException.class, \"Cannot find field 'missing'\",\n () -> new StrictMetricsEvaluator(SCHEMA, lessThan(\"missing\", 5)).eval(FILE));\n }",
"class_me... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_106 | {
"fields": [
{
"declarator": "TEST_LOCATION = \"s3://bucket/test/location\"",
"modifier": "private static final",
"original_string": "private static final String TEST_LOCATION = \"s3://bucket/test/location\";",
"type": "String",
"var_name": "TEST_LOCATION"
},
{
"declar... | {
"body": "@Test\n public void testSortOrder() {\n Schema schema = new Schema(\n Types.NestedField.required(10, \"x\", Types.StringType.get())\n );\n\n TableMetadata meta = TableMetadata.newTableMetadata(\n schema, PartitionSpec.unpartitioned(), null, ImmutableMap.of());\n Assert.assertTrue... | {
"fields": [
{
"declarator": "INITIAL_SEQUENCE_NUMBER = 0",
"modifier": "static final",
"original_string": "static final long INITIAL_SEQUENCE_NUMBER = 0;",
"type": "long",
"var_name": "INITIAL_SEQUENCE_NUMBER"
},
{
"declarator": "DEFAULT_TABLE_FORMAT_VERSION = 1",
... | {
"body": "public SortOrder sortOrder() {\n return sortOrdersById.get(defaultSortOrderId);\n }",
"class_method_signature": "TableMetadata.sortOrder()",
"constructor": false,
"full_signature": "public SortOrder sortOrder()",
"identifier": "sortOrder",
"invocations": [
"get"
],
"modifiers": "publi... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_71 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testAnd() {\n // this test case must use a real predicate, not alwaysTrue(), or binding will simplify it out\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA,\n and(greaterThan(\"id\", INT_MIN_VALUE - 25), lessThanOrEqual(\"id\", INT_MIN_VALUE))).eval(FILE);\n A... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_151 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/mapping/TestNameMapping.java",
"identifier": "TestNameMapping",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFailsDuplicateName() {\n AssertHelpers.assertThrows(\"Should fail if names are reused\",\n IllegalArgumentException.class, \"Multiple entries with same key\",\n () -> new NameMapping(MappedFields.of(MappedField.of(1, \"x\"), MappedField.of(2, \"x\"))));\n }",
"c... | {
"fields": [
{
"declarator": "DOT = Joiner.on('.')",
"modifier": "private static final",
"original_string": "private static final Joiner DOT = Joiner.on('.');",
"type": "Joiner",
"var_name": "DOT"
},
{
"declarator": "mapping",
"modifier": "private final",
"... | {
"body": "public static NameMapping of(MappedField... fields) {\n return new NameMapping(MappedFields.of(ImmutableList.copyOf(fields)));\n }",
"class_method_signature": "NameMapping.of(MappedField... fields)",
"constructor": false,
"full_signature": "public static NameMapping of(MappedField... fields)",
... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_26 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testNoNulls() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, isNull(\"all_nulls\")).eval(FILE);\n Assert.assertTrue(\"Should read: at least one null value in all null column\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA, isNull(\"some_nu... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_51 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testNotEqual() {\n Assert.assertEquals(1, notEqual(\"x\", 5).literals().size());\n\n Evaluator evaluator = new Evaluator(STRUCT, notEqual(\"x\", 7));\n Assert.assertFalse(\"7 != 7 => false\", evaluator.eval(TestHelpers.Row.of(7, 8, null)));\n Assert.assertTrue(\"6 != 7 => t... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_126 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get()),\n optional(9, \"feat... | {
"body": "@Test\n public void testDeleteMissingColumn() {\n AssertHelpers.assertThrows(\"Should reject delete missing column\",\n IllegalArgumentException.class, \"missing column: col\", () -> {\n UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID);\n update.deleteColum... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SchemaUpdate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SchemaUpdate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "@Override\n public UpdateSchema deleteColumn(String name) {\n Types.NestedField field = schema.findField(name);\n Preconditions.checkArgument(field != null, \"Cannot delete missing column: %s\", name);\n Preconditions.checkArgument(!adds.containsKey(field.fieldId()),\n \"Cannot delete a co... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_171 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBetweenOperand() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder\n .startAnd()\n .between(\"salary\", PredicateLeaf.Type.LONG, 3000L, 4000L).end().build();\n\n And expected = (And) Expressions.and(Expres... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_188 | {
"fields": [
{
"declarator": "schema = new Schema(required(1, \"string_field\", Types.StringType.get()))",
"modifier": "private static final",
"original_string": "private static final Schema schema = new Schema(required(1, \"string_field\", Types.StringType.get()));",
"type": "Schema",
... | {
"body": "@Test\n public void testInitialize() throws IOException, SerDeException {\n File location = tmp.newFolder();\n Assert.assertTrue(location.delete());\n\n Configuration conf = new Configuration();\n\n Properties properties = new Properties();\n properties.setProperty(\"location\", location.to... | {
"fields": [
{
"declarator": "inspector",
"modifier": "private",
"original_string": "private ObjectInspector inspector;",
"type": "ObjectInspector",
"var_name": "inspector"
}
],
"file": "mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java",
"identifier": "Hiv... | {
"body": "@Override\n public void initialize(@Nullable Configuration configuration, Properties serDeProperties) throws SerDeException {\n Table table = Catalogs.loadTable(configuration, serDeProperties);\n\n try {\n this.inspector = IcebergObjectInspector.create(table.schema());\n } catch (Exception e... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_10 | {
"fields": [
{
"declarator": "SUPPORTED_PRIMITIVES = Types.StructType.of(\n optional(1, \"intCol\", Types.IntegerType.get()),\n optional(3, \"longCol\", Types.LongType.get()),\n optional(6, \"intCol2\", Types.IntegerType.get()),\n optional(20, \"intCol3\", Types.IntegerType.get()),\n ... | {
"body": "@Test\n public void testRoundtripConversionNested() {\n Types.StructType leafStructType = Types.StructType.of(\n optional(6, \"leafLongCol\", Types.LongType.get()),\n optional(7, \"leafBinaryCol\", Types.BinaryType.get())\n );\n Types.StructType nestedStructType = Types.StructType.o... | {
"fields": [
{
"declarator": "ICEBERG_ID_ATTRIBUTE = \"iceberg.id\"",
"modifier": "static final",
"original_string": "static final String ICEBERG_ID_ATTRIBUTE = \"iceberg.id\";",
"type": "String",
"var_name": "ICEBERG_ID_ATTRIBUTE"
},
{
"declarator": "ICEBERG_REQUIRED_... | {
"body": "public static TypeDescription convert(Schema schema) {\n final TypeDescription root = TypeDescription.createStruct();\n final Types.StructType schemaRoot = schema.asStruct();\n for (Types.NestedField field : schemaRoot.asStructType().fields()) {\n TypeDescription orcColumType = convert(field.... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_167 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNotEqualsOperand() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startNot().equals(\"salary\", PredicateLeaf.Type.LONG, 3000L).end().build();\n\n Not expected = (Not) Expressions.not(Expressions.equal(\"salary\", 30... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_47 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testLessThanOrEqual() {\n Evaluator evaluator = new Evaluator(STRUCT, lessThanOrEqual(\"x\", 7));\n Assert.assertTrue(\"7 <= 7 => true\", evaluator.eval(TestHelpers.Row.of(7, 8, null)));\n Assert.assertTrue(\"6 <= 7 => true\", evaluator.eval(TestHelpers.Row.of(6, 8, null)));\n... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_130 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testEmptyTableAppend() {\n Assert.assertEquals(\"Table should start empty\", 0, listManifestFiles().size());\n\n TableMetadata base = readMetadata();\n Assert.assertNull(\"Should not have a current snapshot\", base.currentSnapshot());\n Assert.assertEquals(\"Last sequence n... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_5 | {
"fields": [
{
"declarator": "CONF = new Configuration()",
"modifier": "private static final",
"original_string": "private static final Configuration CONF = new Configuration();",
"type": "Configuration",
"var_name": "CONF"
},
{
"declarator": "tempFolder = new Temporar... | {
"body": "@Test\n public void testMultipleJobsWriteSameTable() throws Exception {\n long timestamp = 0;\n List<RowData> tableRows = Lists.newArrayList();\n\n JobID[] jobs = new JobID[] {new JobID(), new JobID(), new JobID()};\n for (int i = 0; i < 20; i++) {\n int jobIndex = i % 3;\n int check... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INITIAL_CHECKPOINT_ID = -1L",
"modi... | {
"body": "@Override\n public void processElement(StreamRecord<DataFile> element) {\n this.dataFilesOfCurrentCheckpoint.add(element.getValue());\n }",
"class_method_signature": "IcebergFilesCommitter.processElement(StreamRecord<DataFile> element)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_84 | {
"fields": [],
"file": "api/src/test/java/org/apache/iceberg/types/TestConversions.java",
"identifier": "TestConversions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testByteBufferConversions() {\n // booleans are stored as 0x00 for 'false' and a non-zero byte for 'true'\n assertConversion(false, BooleanType.get(), new byte[]{0x00});\n assertConversion(true, BooleanType.get(), new byte[]{0x01});\n Assert.assertArrayEquals(new byte[]{0x0... | {
"fields": [
{
"declarator": "HIVE_NULL = \"__HIVE_DEFAULT_PARTITION__\"",
"modifier": "private static final",
"original_string": "private static final String HIVE_NULL = \"__HIVE_DEFAULT_PARTITION__\";",
"type": "String",
"var_name": "HIVE_NULL"
},
{
"declarator": "EN... | {
"body": "public static ByteBuffer toByteBuffer(Type type, Object value) {\n return toByteBuffer(type.typeId(), value);\n }",
"class_method_signature": "Conversions.toByteBuffer(Type type, Object value)",
"constructor": false,
"full_signature": "public static ByteBuffer toByteBuffer(Type type, Object value... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_92 | {
"fields": [
{
"declarator": "TABLES = new HadoopTables(new Configuration())",
"modifier": "private static final",
"original_string": "private static final HadoopTables TABLES = new HadoopTables(new Configuration());",
"type": "HadoopTables",
"var_name": "TABLES"
},
{
... | {
"body": "@Test\n public void testRewriteDataFilesEmptyTable() {\n PartitionSpec spec = PartitionSpec.unpartitioned();\n Map<String, String> options = Maps.newHashMap();\n Table table = TABLES.create(SCHEMA, spec, options, tableLocation);\n\n Assert.assertNull(\"Table must be empty\", table.currentSnaps... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "@Override\n public RewriteDataFilesActionResult execute() {\n CloseableIterable<FileScanTask> fileScanTasks = null;\n try {\n fileScanTasks = table.newScan()\n .caseSensitive(caseSensitive)\n .ignoreResiduals()\n .filter(filter)\n .planFiles();\n } finally... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_93 | {
"fields": [
{
"declarator": "TABLES = new HadoopTables(new Configuration())",
"modifier": "private static final",
"original_string": "private static final HadoopTables TABLES = new HadoopTables(new Configuration());",
"type": "HadoopTables",
"var_name": "TABLES"
},
{
... | {
"body": "@Test\n public void testRewriteDataFilesUnpartitionedTable() {\n PartitionSpec spec = PartitionSpec.unpartitioned();\n Map<String, String> options = Maps.newHashMap();\n Table table = TABLES.create(SCHEMA, spec, options, tableLocation);\n\n List<ThreeColumnRecord> records1 = Lists.newArrayList... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "@Override\n public RewriteDataFilesActionResult execute() {\n CloseableIterable<FileScanTask> fileScanTasks = null;\n try {\n fileScanTasks = table.newScan()\n .caseSensitive(caseSensitive)\n .ignoreResiduals()\n .filter(filter)\n .planFiles();\n } finally... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_85 | {
"fields": [],
"file": "api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java",
"identifier": "TestTypeUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReassignIdsDuplicateColumns() {\n Schema schema = new Schema(\n required(0, \"a\", Types.IntegerType.get()),\n required(1, \"A\", Types.IntegerType.get())\n );\n Schema sourceSchema = new Schema(\n required(1, \"a\", Types.IntegerType.get()),\n ... | {
"fields": [
{
"declarator": "MAX_PRECISION = new int[24]",
"modifier": "private static final",
"original_string": "private static final int[] MAX_PRECISION = new int[24];",
"type": "int[]",
"var_name": "MAX_PRECISION"
},
{
"declarator": "REQUIRED_LENGTH = new int[40]"... | {
"body": "public static Schema reassignIds(Schema schema, Schema idSourceSchema) {\n Types.StructType struct = visit(schema, new ReassignIds(idSourceSchema)).asStructType();\n return new Schema(struct.fields());\n }",
"class_method_signature": "TypeUtil.reassignIds(Schema schema, Schema idSourceSchema)",
... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_4 | {
"fields": [
{
"declarator": "CONF = new Configuration()",
"modifier": "private static final",
"original_string": "private static final Configuration CONF = new Configuration();",
"type": "Configuration",
"var_name": "CONF"
},
{
"declarator": "tempFolder = new Temporar... | {
"body": "@Test\n public void testStartAnotherJobToWriteSameTable() throws Exception {\n long checkpointId = 0;\n long timestamp = 0;\n List<RowData> rows = Lists.newArrayList();\n List<RowData> tableRows = Lists.newArrayList();\n\n JobID oldJobId = new JobID();\n try (OneInputStreamOperatorTestHa... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INITIAL_CHECKPOINT_ID = -1L",
"modi... | {
"body": "@Override\n public void processElement(StreamRecord<DataFile> element) {\n this.dataFilesOfCurrentCheckpoint.add(element.getValue());\n }",
"class_method_signature": "IcebergFilesCommitter.processElement(StreamRecord<DataFile> element)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_46 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testLessThan() {\n Evaluator evaluator = new Evaluator(STRUCT, lessThan(\"x\", 7));\n Assert.assertFalse(\"7 < 7 => false\", evaluator.eval(TestHelpers.Row.of(7, 8, null, null)));\n Assert.assertTrue(\"6 < 7 => true\", evaluator.eval(TestHelpers.Row.of(6, 8, null, null)));\n\n... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_131 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testEmptyTableAppendManifest() throws IOException {\n Assert.assertEquals(\"Table should start empty\", 0, listManifestFiles().size());\n\n TableMetadata base = readMetadata();\n Assert.assertNull(\"Should not have a current snapshot\", base.currentSnapshot());\n Assert.ass... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public AppendFiles appendManifest(ManifestFile manifest) {\n Preconditions.checkArgument(!manifest.hasExistingFiles(), \"Cannot append manifest with existing files\");\n Preconditions.checkArgument(!manifest.hasDeletedFiles(), \"Cannot append manifest with deleted files\");\n Precondi... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_189 | {
"fields": [
{
"declarator": "schema = new Schema(required(1, \"string_field\", Types.StringType.get()))",
"modifier": "private static final",
"original_string": "private static final Schema schema = new Schema(required(1, \"string_field\", Types.StringType.get()));",
"type": "Schema",
... | {
"body": "@Test\n public void testDeserialize() {\n HiveIcebergSerDe serDe = new HiveIcebergSerDe();\n\n Record record = RandomGenericData.generate(schema, 1, 0).get(0);\n Container<Record> container = new Container<>();\n container.set(record);\n\n Assert.assertEquals(record, serDe.deserialize(conta... | {
"fields": [
{
"declarator": "inspector",
"modifier": "private",
"original_string": "private ObjectInspector inspector;",
"type": "ObjectInspector",
"var_name": "inspector"
}
],
"file": "mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java",
"identifier": "Hiv... | {
"body": "@Override\n public Object deserialize(Writable writable) {\n return ((Container<?>) writable).get();\n }",
"class_method_signature": "HiveIcebergSerDe.deserialize(Writable writable)",
"constructor": false,
"full_signature": "@Override public Object deserialize(Writable writable)",
"identifier"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_11 | {
"fields": [
{
"declarator": "SUPPORTED_PRIMITIVES = Types.StructType.of(\n optional(1, \"intCol\", Types.IntegerType.get()),\n optional(3, \"longCol\", Types.LongType.get()),\n optional(6, \"intCol2\", Types.IntegerType.get()),\n optional(20, \"intCol3\", Types.IntegerType.get()),\n ... | {
"body": "@Test\n public void testSkipNonIcebergColumns() {\n TypeDescription schema = TypeDescription.createStruct();\n TypeDescription intCol = TypeDescription.createInt();\n intCol.setAttribute(ICEBERG_ID_ATTRIBUTE, \"1\");\n intCol.setAttribute(ICEBERG_REQUIRED_ATTRIBUTE, \"true\");\n TypeDescrip... | {
"fields": [
{
"declarator": "ICEBERG_ID_ATTRIBUTE = \"iceberg.id\"",
"modifier": "static final",
"original_string": "static final String ICEBERG_ID_ATTRIBUTE = \"iceberg.id\";",
"type": "String",
"var_name": "ICEBERG_ID_ATTRIBUTE"
},
{
"declarator": "ICEBERG_REQUIRED_... | {
"body": "public static TypeDescription convert(Schema schema) {\n final TypeDescription root = TypeDescription.createStruct();\n final Types.StructType schemaRoot = schema.asStruct();\n for (Types.NestedField field : schemaRoot.asStructType().fields()) {\n TypeDescription orcColumType = convert(field.... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_166 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEqualsOperand() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startAnd().equals(\"salary\", PredicateLeaf.Type.LONG, 3000L).end().build();\n\n UnboundPredicate expected = Expressions.equal(\"salary\", 3000L);\n U... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_170 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInOperand() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startAnd().in(\"salary\", PredicateLeaf.Type.LONG, 3000L, 4000L).end().build();\n\n UnboundPredicate expected = Expressions.in(\"salary\", 3000L, 4000L);\n ... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_50 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testEqual() {\n Assert.assertEquals(1, equal(\"x\", 5).literals().size());\n\n Evaluator evaluator = new Evaluator(STRUCT, equal(\"x\", 7));\n Assert.assertTrue(\"7 == 7 => true\", evaluator.eval(TestHelpers.Row.of(7, 8, null)));\n Assert.assertFalse(\"6 == 7 => false\", ev... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_127 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get()),\n optional(9, \"feat... | {
"body": "@Test\n public void testRenameMissingColumn() {\n AssertHelpers.assertThrows(\"Should reject rename missing column\",\n IllegalArgumentException.class, \"missing column: col\", () -> {\n UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID);\n update.renameColum... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SchemaUpdate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SchemaUpdate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "@Override\n public UpdateSchema renameColumn(String name, String newName) {\n Types.NestedField field = schema.findField(name);\n Preconditions.checkArgument(field != null, \"Cannot rename missing column: %s\", name);\n Preconditions.checkArgument(newName != null, \"Cannot rename a column to null... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_150 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testIncludedPartitionSummaryLimit() {\n table.updateProperties()\n .set(TableProperties.WRITE_PARTITION_SUMMARY_LIMIT, \"1\")\n .commit();\n\n table.newFastAppend()\n .appendFile(FILE_A)\n .appendFile(FILE_B)\n .commit();\n\n Set<String> part... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_27 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testRequiredColumn() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, notNull(\"required\")).eval(FILE);\n Assert.assertTrue(\"Should read: required columns are always non-null\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA, isNull(\"requir... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_107 | {
"fields": [
{
"declarator": "TEST_LOCATION = \"s3://bucket/test/location\"",
"modifier": "private static final",
"original_string": "private static final String TEST_LOCATION = \"s3://bucket/test/location\";",
"type": "String",
"var_name": "TEST_LOCATION"
},
{
"declar... | {
"body": "@Test\n public void testUpdateSortOrder() {\n Schema schema = new Schema(\n Types.NestedField.required(10, \"x\", Types.StringType.get())\n );\n\n SortOrder order = SortOrder.builderFor(schema).asc(\"x\").build();\n\n TableMetadata sortedByX = TableMetadata.newTableMetadata(\n sc... | {
"fields": [
{
"declarator": "INITIAL_SEQUENCE_NUMBER = 0",
"modifier": "static final",
"original_string": "static final long INITIAL_SEQUENCE_NUMBER = 0;",
"type": "long",
"var_name": "INITIAL_SEQUENCE_NUMBER"
},
{
"declarator": "DEFAULT_TABLE_FORMAT_VERSION = 1",
... | {
"body": "public TableMetadata updateSortOrder(SortOrder newOrder) {\n SortOrder.checkCompatibility(newOrder, schema);\n\n // determine the next order id\n int newOrderId = INITIAL_SORT_ORDER_ID;\n for (SortOrder order : sortOrders) {\n if (order.sameOrder(newOrder)) {\n newOrderId = order.or... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_70 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testNot() {\n // this test case must use a real predicate, not alwaysTrue(), or binding will simplify it out\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, not(lessThan(\"id\", INT_MIN_VALUE - 25))).eval(FILE);\n Assert.assertTrue(\"Should not match: not(false)\", s... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_89 | {
"fields": [
{
"declarator": "TEST_SCHEMA = new Schema(\n optional(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get())\n )",
"modifier": "private static final",
"original_string": "private static final Schema TEST_SCHEMA = new Schema(\n optional(... | {
"body": "@Test\n public void testEstiamteSizeMaxValue() throws IOException {\n Assert.assertEquals(\"estimateSize returns Long max value\", Long.MAX_VALUE,\n SparkSchemaUtil.estimateSize(\n null,\n Long.MAX_VALUE));\n }",
"class_method_signature": "TestSparkSchemaUtil.testEstiamt... | {
"fields": [],
"file": "spark/src/main/java/org/apache/iceberg/spark/SparkSchemaUtil.java",
"identifier": "SparkSchemaUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "SparkSchemaUtil.SparkSchemaUtil()",
"constructor": true,
"full_signature": "private SparkSchemaUtil()... | {
"body": "public static long estimateSize(StructType tableSchema, long totalRecords) {\n if (totalRecords == Long.MAX_VALUE) {\n return totalRecords;\n }\n\n long approximateSize = 0;\n for (StructField sparkField : tableSchema.fields()) {\n approximateSize += sparkField.dataType().defaultSize(... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_111 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestPartitionSpecParser.java",
"identifier": "TestPartitionSpecParser",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testFromJsonWithFieldId() {\n String specString = \"{\\n\" +\n \" \\\"spec-id\\\" : 1,\\n\" +\n \" \\\"fields\\\" : [ {\\n\" +\n \" \\\"name\\\" : \\\"id_bucket\\\",\\n\" +\n \" \\\"transform\\\" : \\\"bucket[8]\\\",\\n\" +\n \" \\\"sour... | {
"fields": [
{
"declarator": "SPEC_ID = \"spec-id\"",
"modifier": "private static final",
"original_string": "private static final String SPEC_ID = \"spec-id\";",
"type": "String",
"var_name": "SPEC_ID"
},
{
"declarator": "FIELDS = \"fields\"",
"modifier": "priva... | {
"body": "public static PartitionSpec fromJson(Schema schema, JsonNode json) {\n Preconditions.checkArgument(json.isObject(), \"Cannot parse spec from non-object: %s\", json);\n int specId = JsonUtil.getInt(SPEC_ID, json);\n PartitionSpec.Builder builder = PartitionSpec.builderFor(schema).withSpecId(specId)... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_66 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testRequiredColumn() {\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, notNull(\"required\")).eval(FILE);\n Assert.assertTrue(\"Should match: required columns are always non-null\", shouldRead);\n\n shouldRead = new StrictMetricsEvaluator(SCHEMA, isNull(\"required\")... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_8 | {
"fields": [],
"file": "orc/src/test/java/org/apache/iceberg/orc/TestExpressionToSearchArgument.java",
"identifier": "TestExpressionToSearchArgument",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testModifiedSimpleSchemaNameMapping() {\n Schema originalSchema = new Schema(\n required(1, \"int\", Types.IntegerType.get()),\n optional(2, \"long_to_be_dropped\", Types.LongType.get())\n );\n Schema mappingSchema = new Schema(\n required(1, \"int\", Type... | {
"fields": [
{
"declarator": "UNSUPPORTED_TYPES = ImmutableSet.of(\n TypeID.TIMESTAMP, // Temporarily disable filters on Timestamp columns due to ORC-611\n TypeID.BINARY,\n TypeID.FIXED,\n TypeID.UUID,\n TypeID.STRUCT,\n TypeID.MAP,\n TypeID.LIST\n )",
"modifier": ... | {
"body": "static SearchArgument convert(Expression expr, TypeDescription readSchema) {\n Map<Integer, String> idToColumnName = ORCSchemaUtil.idToOrcName(ORCSchemaUtil.convert(readSchema));\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n ExpressionVisitors.visit(expr, new ExpressionT... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_146 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testInvalidAppendManifest() throws IOException {\n Assert.assertEquals(\"Table should start empty\", 0, listManifestFiles().size());\n\n TableMetadata base = readMetadata();\n Assert.assertNull(\"Should not have a current snapshot\", base.currentSnapshot());\n\n ManifestFil... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public AppendFiles appendManifest(ManifestFile manifest) {\n Preconditions.checkArgument(!manifest.hasExistingFiles(), \"Cannot append manifest with existing files\");\n Preconditions.checkArgument(!manifest.hasDeletedFiles(), \"Cannot append manifest with deleted files\");\n Precondi... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_31 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testNot() {\n // this test case must use a real predicate, not alwaysTrue(), or binding will simplify it out\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, not(lessThan(\"id\", INT_MIN_VALUE - 25))).eval(FILE);\n Assert.assertTrue(\"Should read: not(false)\", sho... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_185 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/serde/objectinspector/TestIcebergDecimalObjectInspector.java",
"identifier": "TestIcebergDecimalObjectInspector",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIcebergDecimalObjectInspector() {\n HiveDecimalObjectInspector oi = IcebergDecimalObjectInspector.get(38, 18);\n\n Assert.assertEquals(ObjectInspector.Category.PRIMITIVE, oi.getCategory());\n Assert.assertEquals(PrimitiveObjectInspector.PrimitiveCategory.DECIMAL, oi.getPri... | {
"fields": [
{
"declarator": "CACHE = Caffeine.newBuilder()\n .expireAfterAccess(10, TimeUnit.MINUTES)\n .build()",
"modifier": "private static final",
"original_string": "private static final Cache<Integer, IcebergDecimalObjectInspector> CACHE = Caffeine.newBuilder()\n ... | {
"body": "private IcebergDecimalObjectInspector(int precision, int scale) {\n super(new DecimalTypeInfo(precision, scale));\n }",
"class_method_signature": "IcebergDecimalObjectInspector.IcebergDecimalObjectInspector(int precision, int scale)",
"constructor": true,
"full_signature": "private IcebergDecima... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_57 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testOr() {\n Evaluator evaluator = new Evaluator(STRUCT, or(equal(\"x\", 7), notNull(\"z\")));\n Assert.assertTrue(\"7, 3 => true\", evaluator.eval(TestHelpers.Row.of(7, 0, 3)));\n Assert.assertTrue(\"8, 3 => true\", evaluator.eval(TestHelpers.Row.of(8, 0, 3)));\n Assert.as... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_120 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get()),\n optional(9, \"feat... | {
"body": "@Test\n public void testAddFields() {\n Schema expected = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get())... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SchemaUpdate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SchemaUpdate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "private static List<Types.NestedField> addFields(List<Types.NestedField> fields,\n Collection<Types.NestedField> adds) {\n List<Types.NestedField> newFields = Lists.newArrayList(fields);\n newFields.addAll(adds);\n return newFields;\n }",
"class... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_177 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBooleanType() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startAnd().equals(\"boolean\", PredicateLeaf.Type.BOOLEAN, true).end().build();\n\n UnboundPredicate expected = Expressions.equal(\"boolean\", true);\n ... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_16 | {
"fields": [],
"file": "pig/src/test/java/org/apache/iceberg/pig/SchemaUtilTest.java",
"identifier": "SchemaUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPrimitive() throws IOException {\n Schema icebergSchema = new Schema(\n optional(1, \"b\", BooleanType.get()),\n optional(2, \"i\", IntegerType.get()),\n optional(3, \"l\", LongType.get()),\n optional(4, \"f\", FloatType.get()),\n optional(5, \... | {
"fields": [],
"file": "pig/src/main/java/org/apache/iceberg/pig/SchemaUtil.java",
"identifier": "SchemaUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchemaUtil.SchemaUtil()",
"constructor": true,
"full_signature": "private SchemaUtil()",
"identifier": "Schem... | {
"body": "public static ResourceSchema convert(Schema icebergSchema) throws IOException {\n ResourceSchema result = new ResourceSchema();\n result.setFields(convertFields(icebergSchema.columns()));\n return result;\n }",
"class_method_signature": "SchemaUtil.convert(Schema icebergSchema)",
"constructor... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_161 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testListTables() throws Exception {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n\n TableIdentifier tbl1 = TableIdentifier.of(\"db\", \"tbl1\");\n ... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public List<TableIdentifier> listTables(Namespace namespace) {\n Preconditions.checkArgument(namespace.levels().length >= 1,\n \"Missing database in table identifier: %s\", namespace);\n\n Path nsPath = new Path(warehouseLocation, SLASH.join(namespace.levels()));\n Set<TableIde... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_41 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testCaseInsensitiveIntegerNotEqRewritten() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, not(equal(\"ID\", INT_MIN_VALUE - 25)), false).eval(FILE);\n Assert.assertTrue(\"Should read: id below lower bound\", shouldRead);\n\n shouldRead = new InclusiveMetricsEva... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_136 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testMinMergeCount() {\n // only merge when there are at least 4 manifests\n table.updateProperties().set(\"commit.manifest.min-count-to-merge\", \"4\").commit();\n\n Assert.assertEquals(\"Last sequence number should be 0\", 0, readMetadata().lastSequenceNumber());\n Assert.... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_3 | {
"fields": [
{
"declarator": "CONF = new Configuration()",
"modifier": "private static final",
"original_string": "private static final Configuration CONF = new Configuration();",
"type": "Configuration",
"var_name": "CONF"
},
{
"declarator": "tempFolder = new Temporar... | {
"body": "@Test\n public void testDisorderedEventsBetweenCheckpoints() throws Exception {\n // It's possible that the two checkpoints happen in the following orders:\n // 1. snapshotState for checkpoint#1;\n // 2. snapshotState for checkpoint#2;\n // 3. notifyCheckpointComplete for checkpoint#2;\n... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INITIAL_CHECKPOINT_ID = -1L",
"modi... | {
"body": "@Override\n public void processElement(StreamRecord<DataFile> element) {\n this.dataFilesOfCurrentCheckpoint.add(element.getValue());\n }",
"class_method_signature": "IcebergFilesCommitter.processElement(StreamRecord<DataFile> element)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_82 | {
"fields": [],
"file": "api/src/test/java/org/apache/iceberg/events/TestListeners.java",
"identifier": "TestListeners",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEvent1() {\n Event1 e1 = new Event1();\n\n Listeners.notifyAll(e1);\n\n Assert.assertEquals(e1, TestListener.get().e1);\n }",
"class_method_signature": "TestListeners.testEvent1()",
"constructor": false,
"full_signature": "@Test public void testEvent1()",
"identif... | {
"fields": [
{
"declarator": "listeners = Maps.newConcurrentMap()",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Queue<Listener<?>>> listeners = Maps.newConcurrentMap();",
"type": "Map<Class<?>, Queue<Listener<?>>>",
"var_name": "listene... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <E> void notifyAll(E event) {\n Preconditions.checkNotNull(event, \"Cannot notify listeners for a null event.\");\n\n Queue<Listener<?>> list = listeners.get(event.getClass());\n if (list != null) {\n for (Listener<?> value : list) {\n ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_94 | {
"fields": [
{
"declarator": "TABLES = new HadoopTables(new Configuration())",
"modifier": "private static final",
"original_string": "private static final HadoopTables TABLES = new HadoopTables(new Configuration());",
"type": "HadoopTables",
"var_name": "TABLES"
},
{
... | {
"body": "@Test\n public void testRewriteDataFilesPartitionedTable() {\n PartitionSpec spec = PartitionSpec.builderFor(SCHEMA)\n .identity(\"c1\")\n .truncate(\"c2\", 2)\n .build();\n Map<String, String> options = Maps.newHashMap();\n Table table = TABLES.create(SCHEMA, spec, options, ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RewriteDataFilesAction.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "@Override\n public RewriteDataFilesActionResult execute() {\n CloseableIterable<FileScanTask> fileScanTasks = null;\n try {\n fileScanTasks = table.newScan()\n .caseSensitive(caseSensitive)\n .ignoreResiduals()\n .filter(filter)\n .planFiles();\n } finally... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_182 | {
"fields": [
{
"declarator": "schema = new Schema(\n required(1, \"binary_field\", Types.BinaryType.get(), \"binary comment\"),\n required(2, \"boolean_field\", Types.BooleanType.get(), \"boolean comment\"),\n required(3, \"date_field\", Types.DateType.get(), \"date comment\"),\n... | {
"body": "@Test\n public void testIcebergObjectInspector() {\n ObjectInspector oi = IcebergObjectInspector.create(schema);\n Assert.assertNotNull(oi);\n Assert.assertEquals(ObjectInspector.Category.STRUCT, oi.getCategory());\n\n StructObjectInspector soi = (StructObjectInspector) oi;\n\n // binary\n ... | {
"fields": [
{
"declarator": "DATE_INSPECTOR = DynMethods.builder(\"get\")\n .impl(\"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergDateObjectInspectorHive3\")\n .impl(\"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergDateObjectInspector\")\n .buildStatic()\n .invoke()"... | {
"body": "public static ObjectInspector create(@Nullable Schema schema) {\n if (schema == null) {\n return IcebergRecordObjectInspector.empty();\n }\n\n return TypeUtil.visit(schema, new IcebergObjectInspector());\n }",
"class_method_signature": "IcebergObjectInspector.create(@Nullable Schema schema... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_141 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testAppendManifestCleanup() throws IOException {\n // inject 5 failures\n TestTables.TestTableOperations ops = table.ops();\n ops.failCommits(5);\n\n ManifestFile manifest = writeManifest(FILE_A, FILE_B);\n AppendFiles append = table.newAppend().appendManifest(manifest);... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public AppendFiles appendManifest(ManifestFile manifest) {\n Preconditions.checkArgument(!manifest.hasExistingFiles(), \"Cannot append manifest with existing files\");\n Preconditions.checkArgument(!manifest.hasDeletedFiles(), \"Cannot append manifest with deleted files\");\n Precondi... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_36 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testIntegerGt() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, greaterThan(\"id\", INT_MAX_VALUE + 6)).eval(FILE);\n Assert.assertFalse(\"Should not read: id range above upper bound (85 < 79)\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_116 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestIncrementalDataTableScan.java",
"identifier": "TestIncrementalDataTableScan",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testIgnoreResiduals() throws IOException {\n add(table.newAppend(), files(\"A\"));\n add(table.newAppend(), files(\"B\"));\n add(table.newAppend(), files(\"C\"));\n\n TableScan scan1 = table.newScan()\n .filter(Expressions.equal(\"id\", 5))\n .appendsBetween(1... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java",
"identifier": "IncrementalDataTableScan",
"interfaces": "",
"methods": [
{
"class_method_signature": "IncrementalDataTableScan.IncrementalDataTableScan(TableOperations ops, Table table, Schema schema, Tabl... | {
"body": "@Override\n public TableScan appendsBetween(long newFromSnapshotId, long newToSnapshotId) {\n validateSnapshotIdsRefinement(newFromSnapshotId, newToSnapshotId);\n return new IncrementalDataTableScan(tableOps(), table(), schema(),\n context().fromSnapshotId(newFromSnapshotId).toSnapshotId(newT... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_61 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testIn() {\n Assert.assertEquals(3, in(\"s\", 7, 8, 9).literals().size());\n Assert.assertEquals(3, in(\"s\", 7, 8.1, Long.MAX_VALUE).literals().size());\n Assert.assertEquals(3, in(\"s\", \"abc\", \"abd\", \"abc\").literals().size());\n Assert.assertEquals(0, in(\"s\").lit... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_98 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testInPartition() {\n table.newAppend()\n .appendFile(FILE_A) // bucket 0\n .appendFile(FILE_B) // bucket 1\n .appendFile(FILE_C) // bucket 2\n .appendFile(FILE_D) // bucket 3\n .commit();\n\n Iterable<DataFile> files = FindFiles.in(table)\n ... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_100 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testAsOfTimestamp() {\n table.newAppend()\n .appendFile(FILE_A)\n .commit();\n\n table.newAppend()\n .appendFile(FILE_B)\n .commit();\n\n long timestamp = System.currentTimeMillis();\n\n table.newAppend()\n .appendFile(FILE_C)\n .co... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_77 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testIntegerEq() {\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, equal(\"id\", INT_MIN_VALUE - 25)).eval(FILE);\n Assert.assertFalse(\"Should not match: all values != 5\", shouldRead);\n\n shouldRead = new StrictMetricsEvaluator(SCHEMA, equal(\"id\", INT_MIN_VALUE))... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_157 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testTableBuilderWithLocation() throws Exception {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n TableIdentifier tableIdent = TableIdentifier.of(\"d... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public TableBuilder buildTable(TableIdentifier identifier, Schema schema) {\n return new HadoopCatalogTableBuilder(identifier, schema);\n }",
"class_method_signature": "HadoopCatalog.buildTable(TableIdentifier identifier, Schema schema)",
"constructor": false,
"full_signature": "@Ove... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_20 | {
"fields": [
{
"declarator": "hiveLocalDir = \"file:/tmp/hive/\" + UUID.randomUUID().toString()",
"modifier": "private static final",
"original_string": "private static final String hiveLocalDir = \"file:/tmp/hive/\" + UUID.randomUUID().toString();",
"type": "String",
"var_name": "h... | {
"body": "@Test\n public void testCreateTableDefaultSortOrder() {\n Schema schema = new Schema(\n required(1, \"id\", Types.IntegerType.get(), \"unique ID\"),\n required(2, \"data\", Types.StringType.get())\n );\n PartitionSpec spec = PartitionSpec.builderFor(schema)\n .bucket(\"data\"... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HiveCatalog.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HiveCatalog.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@Override\n public boolean dropTable(TableIdentifier identifier, boolean purge) {\n if (!isValidIdentifier(identifier)) {\n return false;\n }\n\n String database = identifier.namespace().level(0);\n\n TableOperations ops = newTableOps(identifier);\n TableMetadata lastMetadata;\n if ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_156 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testReplaceTxnBuilder() throws Exception {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n TableIdentifier tableIdent = TableIdentifier.of(\"db\", \"... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public TableBuilder buildTable(TableIdentifier identifier, Schema schema) {\n return new HadoopCatalogTableBuilder(identifier, schema);\n }",
"class_method_signature": "HadoopCatalog.buildTable(TableIdentifier identifier, Schema schema)",
"constructor": false,
"full_signature": "@Ove... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_21 | {
"fields": [
{
"declarator": "hiveLocalDir = \"file:/tmp/hive/\" + UUID.randomUUID().toString()",
"modifier": "private static final",
"original_string": "private static final String hiveLocalDir = \"file:/tmp/hive/\" + UUID.randomUUID().toString();",
"type": "String",
"var_name": "h... | {
"body": "@Test\n public void testCreateTableCustomSortOrder() {\n Schema schema = new Schema(\n required(1, \"id\", Types.IntegerType.get(), \"unique ID\"),\n required(2, \"data\", Types.StringType.get())\n );\n PartitionSpec spec = PartitionSpec.builderFor(schema)\n .bucket(\"data\",... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HiveCatalog.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HiveCatalog.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@Override\n public boolean dropTable(TableIdentifier identifier, boolean purge) {\n if (!isValidIdentifier(identifier)) {\n return false;\n }\n\n String database = identifier.namespace().level(0);\n\n TableOperations ops = newTableOps(identifier);\n TableMetadata lastMetadata;\n if ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_99 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testInPartitions() {\n table.newAppend()\n .appendFile(FILE_A) // bucket 0\n .appendFile(FILE_B) // bucket 1\n .appendFile(FILE_C) // bucket 2\n .appendFile(FILE_D) // bucket 3\n .commit();\n\n Iterable<DataFile> files = FindFiles.in(table)\n ... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_101 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testSnapshotId() {\n table.newAppend()\n .appendFile(FILE_A)\n .appendFile(FILE_B)\n .commit();\n\n table.newAppend()\n .appendFile(FILE_C)\n .commit();\n\n long snapshotId = table.currentSnapshot().snapshotId();\n\n table.newAppend()\n ... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_76 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testIntegerGtEq() {\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, greaterThanOrEqual(\"id\", INT_MAX_VALUE + 1)).eval(FILE);\n Assert.assertFalse(\"Should not match: no values in range\", shouldRead);\n\n shouldRead = new StrictMetricsEvaluator(SCHEMA, greaterThanO... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_117 | {
"fields": [
{
"declarator": "exceptionRule = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exceptionRule = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exceptionRule"
}
],
"file": "co... | {
"body": "@Test\n public void testMetricsModeParsing() {\n Assert.assertEquals(None.get(), MetricsModes.fromString(\"none\"));\n Assert.assertEquals(None.get(), MetricsModes.fromString(\"nOnE\"));\n Assert.assertEquals(Counts.get(), MetricsModes.fromString(\"counts\"));\n Assert.assertEquals(Counts.get(... | {
"fields": [
{
"declarator": "TRUNCATE = Pattern.compile(\"truncate\\\\((\\\\d+)\\\\)\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRUNCATE = Pattern.compile(\"truncate\\\\((\\\\d+)\\\\)\");",
"type": "Pattern",
"var_name": "TRUNCATE"
... | {
"body": "public static MetricsMode fromString(String mode) {\n if (\"none\".equalsIgnoreCase(mode)) {\n return None.get();\n } else if (\"counts\".equalsIgnoreCase(mode)) {\n return Counts.get();\n } else if (\"full\".equalsIgnoreCase(mode)) {\n return Full.get();\n }\n\n Matcher trunc... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_60 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testCharSeqValue() {\n StructType struct = StructType.of(required(34, \"s\", Types.StringType.get()));\n Evaluator evaluator = new Evaluator(struct, equal(\"s\", \"abc\"));\n Assert.assertTrue(\"string(abc) == utf8(abc) => true\",\n evaluator.eval(TestHelpers.Row.of(new... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_140 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testFailure() {\n // merge all manifests for this test\n table.updateProperties().set(\"commit.manifest.min-count-to-merge\", \"1\").commit();\n Assert.assertEquals(\"Last sequence number should be 0\", 0, readMetadata().lastSequenceNumber());\n\n table.newAppend()\n ... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_37 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testIntegerGtEq() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, greaterThanOrEqual(\"id\", INT_MAX_VALUE + 6)).eval(FILE);\n Assert.assertFalse(\"Should not read: id range above upper bound (85 < 79)\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluat... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_183 | {
"fields": [
{
"declarator": "schema = new Schema(\n required(1, \"binary_field\", Types.BinaryType.get(), \"binary comment\"),\n required(2, \"boolean_field\", Types.BooleanType.get(), \"boolean comment\"),\n required(3, \"date_field\", Types.DateType.get(), \"date comment\"),\n... | {
"body": "@Test\n public void testIcebergObjectInspectorUnsupportedTypes() {\n AssertHelpers.assertThrows(\n \"Hive does not support time type\", IllegalArgumentException.class, \"TIME type is not supported\",\n () -> IcebergObjectInspector.create(required(1, \"time_field\", Types.TimeType.get())))... | {
"fields": [
{
"declarator": "DATE_INSPECTOR = DynMethods.builder(\"get\")\n .impl(\"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergDateObjectInspectorHive3\")\n .impl(\"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergDateObjectInspector\")\n .buildStatic()\n .invoke()"... | {
"body": "public static ObjectInspector create(@Nullable Schema schema) {\n if (schema == null) {\n return IcebergRecordObjectInspector.empty();\n }\n\n return TypeUtil.visit(schema, new IcebergObjectInspector());\n }",
"class_method_signature": "IcebergObjectInspector.create(@Nullable Schema schema... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_95 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testBasicBehavior() {\n table.newAppend()\n .appendFile(FILE_A)\n .appendFile(FILE_B)\n .commit();\n\n Iterable<DataFile> files = FindFiles.in(table).collect();\n\n Assert.assertEquals(pathSet(FILE_A, FILE_B), pathSet(files));\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_83 | {
"fields": [],
"file": "api/src/test/java/org/apache/iceberg/events/TestListeners.java",
"identifier": "TestListeners",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEvent2() {\n Event2 e2 = new Event2();\n\n Listeners.notifyAll(e2);\n\n Assert.assertEquals(e2, TestListener.get().e2);\n }",
"class_method_signature": "TestListeners.testEvent2()",
"constructor": false,
"full_signature": "@Test public void testEvent2()",
"identif... | {
"fields": [
{
"declarator": "listeners = Maps.newConcurrentMap()",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Queue<Listener<?>>> listeners = Maps.newConcurrentMap();",
"type": "Map<Class<?>, Queue<Listener<?>>>",
"var_name": "listene... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <E> void notifyAll(E event) {\n Preconditions.checkNotNull(event, \"Cannot notify listeners for a null event.\");\n\n Queue<Listener<?>> list = listeners.get(event.getClass());\n if (list != null) {\n for (Listener<?> value : list) {\n ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_2 | {
"fields": [
{
"declarator": "CONF = new Configuration()",
"modifier": "private static final",
"original_string": "private static final Configuration CONF = new Configuration();",
"type": "Configuration",
"var_name": "CONF"
},
{
"declarator": "tempFolder = new Temporar... | {
"body": "@Test\n public void testOrderedEventsBetweenCheckpoints() throws Exception {\n // It's possible that two checkpoints happen in the following orders:\n // 1. snapshotState for checkpoint#1;\n // 2. snapshotState for checkpoint#2;\n // 3. notifyCheckpointComplete for checkpoint#1;\n // ... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INITIAL_CHECKPOINT_ID = -1L",
"modi... | {
"body": "@Override\n public void processElement(StreamRecord<DataFile> element) {\n this.dataFilesOfCurrentCheckpoint.add(element.getValue());\n }",
"class_method_signature": "IcebergFilesCommitter.processElement(StreamRecord<DataFile> element)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_40 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testIntegerNotEqRewritten() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, not(equal(\"id\", INT_MIN_VALUE - 25))).eval(FILE);\n Assert.assertTrue(\"Should read: id below lower bound\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA, not(equ... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_137 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testMergeSizeTargetWithExistingManifest() {\n // use a small limit on manifest size to prevent merging\n table.updateProperties()\n .set(TableProperties.MANIFEST_TARGET_SIZE_BYTES, \"10\")\n .commit();\n\n Assert.assertEquals(\"Last sequence number should be 0\",... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public MergeAppend appendFile(DataFile file) {\n add(file);\n return this;\n }",
"class_method_signature": "MergeAppend.appendFile(DataFile file)",
"constructor": false,
"full_signature": "@Override public MergeAppend appendFile(DataFile file)",
"identifier": "appendFile",
"in... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_17 | {
"fields": [],
"file": "pig/src/test/java/org/apache/iceberg/pig/SchemaUtilTest.java",
"identifier": "SchemaUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTupleInMap() throws IOException {\n Schema icebergSchema = new Schema(\n optional(\n 1, \"nested_list\",\n MapType.ofOptional(\n 2, 3,\n StringType.get(),\n ListType.ofOptional(\n 4, Str... | {
"fields": [],
"file": "pig/src/main/java/org/apache/iceberg/pig/SchemaUtil.java",
"identifier": "SchemaUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchemaUtil.SchemaUtil()",
"constructor": true,
"full_signature": "private SchemaUtil()",
"identifier": "Schem... | {
"body": "public static ResourceSchema convert(Schema icebergSchema) throws IOException {\n ResourceSchema result = new ResourceSchema();\n result.setFields(convertFields(icebergSchema.columns()));\n return result;\n }",
"class_method_signature": "SchemaUtil.convert(Schema icebergSchema)",
"constructor... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_160 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testRenameTable() throws Exception {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n TableIdentifier testTable = TableIdentifier.of(\"db\", \"tbl1\")... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public void renameTable(TableIdentifier from, TableIdentifier to) {\n throw new UnsupportedOperationException(\"Cannot rename Hadoop tables\");\n }",
"class_method_signature": "HadoopCatalog.renameTable(TableIdentifier from, TableIdentifier to)",
"constructor": false,
"full_signature... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_176 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFloatType() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startAnd().equals(\"float\", PredicateLeaf.Type.FLOAT, 1200D).end().build();\n\n UnboundPredicate expected = Expressions.equal(\"float\", 1200D);\n Unboun... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_56 | {
"fields": [
{
"declarator": "STRUCT = StructType.of(\n required(13, \"x\", Types.IntegerType.get()),\n required(14, \"y\", Types.DoubleType.get()),\n optional(15, \"z\", Types.IntegerType.get()),\n optional(16, \"s1\", Types.StructType.of(\n Types.NestedField.required(17, \"s2... | {
"body": "@Test\n public void testAnd() {\n Evaluator evaluator = new Evaluator(STRUCT, and(equal(\"x\", 7), notNull(\"z\")));\n Assert.assertTrue(\"7, 3 => true\", evaluator.eval(TestHelpers.Row.of(7, 0, 3)));\n Assert.assertFalse(\"8, 3 => false\", evaluator.eval(TestHelpers.Row.of(8, 0, 3)));\n Asser... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
}
],
"file": "api/src/main/java/org/apache/iceberg/expressions/Evaluator.java",
"identifier": "Evaluator",
"int... | {
"body": "public boolean eval(StructLike data) {\n return new EvalVisitor().eval(data);\n }",
"class_method_signature": "Evaluator.eval(StructLike data)",
"constructor": false,
"full_signature": "public boolean eval(StructLike data)",
"identifier": "eval",
"invocations": [
"eval"
],
"modifiers"... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_121 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get()),\n optional(9, \"feat... | {
"body": "@Test\n public void testAddRequiredColumn() {\n Schema schema = new Schema(required(1, \"id\", Types.IntegerType.get()));\n Schema expected = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n required(2, \"data\", Types.StringType.get()));\n\n AssertHelpers.assertThrows(... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SchemaUpdate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SchemaUpdate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "@Override\n public UpdateSchema addRequiredColumn(String name, Type type, String doc) {\n Preconditions.checkArgument(!name.contains(\".\"),\n \"Cannot add column with ambiguous name: %s, use addColumn(parent, name, type)\", name);\n addRequiredColumn(null, name, type, doc);\n return this;... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_159 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testDropTable() throws Exception {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n TableIdentifier testTable = TableIdentifier.of(\"db\", \"ns1\", \"... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public boolean dropTable(TableIdentifier identifier, boolean purge) {\n if (!isValidIdentifier(identifier)) {\n throw new NoSuchTableException(\"Invalid identifier: %s\", identifier);\n }\n\n Path tablePath = new Path(defaultWarehouseLocation(identifier));\n TableOperations op... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_79 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testIntegerNotEqRewritten() {\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, not(equal(\"id\", INT_MIN_VALUE - 25))).eval(FILE);\n Assert.assertTrue(\"Should match: no values == 5\", shouldRead);\n\n shouldRead = new StrictMetricsEvaluator(SCHEMA, not(equal(\"id\", ... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_96 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestFindFiles.java",
"identifier": "TestFindFiles",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testWithMetadataMatching() {\n table.newAppend()\n .appendFile(FILE_A)\n .appendFile(FILE_B)\n .appendFile(FILE_C)\n .appendFile(FILE_D)\n .commit();\n\n Iterable<DataFile> files = FindFiles.in(table)\n .withMetadataMatching(Expressions.s... | {
"fields": [
{
"declarator": "DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\")",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss.SSS\");",
"type": "DateTime... | {
"body": "public static Builder in(Table table) {\n return new Builder(table);\n }",
"class_method_signature": "FindFiles.in(Table table)",
"constructor": false,
"full_signature": "public static Builder in(Table table)",
"identifier": "in",
"invocations": [],
"modifiers": "public static",
"paramete... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_80 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", IntegerType.get()),\n required(3, \"required\", StringType.get()),\n optional(4, \"all_nulls\", StringType.get()),\n optional(5, \"some_nulls\", StringType.get()... | {
"body": "@Test\n public void testIntegerIn() {\n boolean shouldRead = new StrictMetricsEvaluator(SCHEMA,\n in(\"id\", INT_MIN_VALUE - 25, INT_MIN_VALUE - 24)).eval(FILE);\n Assert.assertFalse(\"Should not match: all values != 5 and != 6\", shouldRead);\n\n shouldRead = new StrictMetricsEvaluator(SC... | {
"fields": [
{
"declarator": "schema",
"modifier": "private final",
"original_string": "private final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "struct",
"modifier": "private final",
"original_string": "private final StructT... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "StrictMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"full... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_118 | {
"fields": [
{
"declarator": "exceptionRule = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exceptionRule = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exceptionRule"
}
],
"file": "co... | {
"body": "@Test\n public void testInvalidTruncationLength() {\n exceptionRule.expect(IllegalArgumentException.class);\n exceptionRule.expectMessage(\"length should be positive\");\n MetricsModes.fromString(\"truncate(0)\");\n }",
"class_method_signature": "TestMetricsModes.testInvalidTruncationLength()"... | {
"fields": [
{
"declarator": "TRUNCATE = Pattern.compile(\"truncate\\\\((\\\\d+)\\\\)\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRUNCATE = Pattern.compile(\"truncate\\\\((\\\\d+)\\\\)\");",
"type": "Pattern",
"var_name": "TRUNCATE"
... | {
"body": "public static MetricsMode fromString(String mode) {\n if (\"none\".equalsIgnoreCase(mode)) {\n return None.get();\n } else if (\"counts\".equalsIgnoreCase(mode)) {\n return Counts.get();\n } else if (\"full\".equalsIgnoreCase(mode)) {\n return Full.get();\n }\n\n Matcher trunc... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_38 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testIntegerEq() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, equal(\"id\", INT_MIN_VALUE - 25)).eval(FILE);\n Assert.assertFalse(\"Should not read: id below lower bound\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA, equal(\"id\", INT_M... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_1 | {
"fields": [
{
"declarator": "CONF = new Configuration()",
"modifier": "private static final",
"original_string": "private static final Configuration CONF = new Configuration();",
"type": "Configuration",
"var_name": "CONF"
},
{
"declarator": "tempFolder = new Temporar... | {
"body": "@Test\n public void testCommitTxn() throws Exception {\n // Test with 3 continues checkpoints:\n // 1. snapshotState for checkpoint#1\n // 2. notifyCheckpointComplete for checkpoint#1\n // 3. snapshotState for checkpoint#2\n // 4. notifyCheckpointComplete for checkpoint#2\n // ... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INITIAL_CHECKPOINT_ID = -1L",
"modi... | {
"body": "@Override\n public void processElement(StreamRecord<DataFile> element) {\n this.dataFilesOfCurrentCheckpoint.add(element.getValue());\n }",
"class_method_signature": "IcebergFilesCommitter.processElement(StreamRecord<DataFile> element)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_134 | {
"fields": [],
"file": "core/src/test/java/org/apache/iceberg/TestMergeAppend.java",
"identifier": "TestMergeAppend",
"interfaces": "",
"superclass": "extends TableTestBase"
} | {
"body": "@Test\n public void testManifestDoNotMergeMinCount() throws IOException {\n Assert.assertEquals(\"Table should start empty\", 0, listManifestFiles().size());\n table.updateProperties().set(\"commit.manifest.min-count-to-merge\", \"4\").commit();\n\n TableMetadata base = readMetadata();\n Asser... | {
"fields": [],
"file": "core/src/main/java/org/apache/iceberg/MergeAppend.java",
"identifier": "MergeAppend",
"interfaces": "implements AppendFiles",
"methods": [
{
"class_method_signature": "MergeAppend.MergeAppend(String tableName, TableOperations ops)",
"constructor": true,
"full_sig... | {
"body": "@Override\n public AppendFiles appendManifest(ManifestFile manifest) {\n Preconditions.checkArgument(!manifest.hasExistingFiles(), \"Cannot append manifest with existing files\");\n Preconditions.checkArgument(!manifest.hasDeletedFiles(), \"Cannot append manifest with deleted files\");\n Precondi... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_43 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", IntegerType.get()),\n optional(2, \"no_stats\", Types.IntegerType.get()),\n required(3, \"required\", Types.StringType.get()),\n optional(4, \"all_nulls\", Types.StringType.get()),\n optional(5, \"some_nulls\"... | {
"body": "@Test\n public void testStringStartsWith() {\n boolean shouldRead = new InclusiveMetricsEvaluator(SCHEMA, startsWith(\"required\", \"a\"), true).eval(FILE);\n Assert.assertTrue(\"Should read: no stats\", shouldRead);\n\n shouldRead = new InclusiveMetricsEvaluator(SCHEMA, startsWith(\"required\", ... | {
"fields": [
{
"declarator": "expr",
"modifier": "private final",
"original_string": "private final Expression expr;",
"type": "Expression",
"var_name": "expr"
},
{
"declarator": "ROWS_MIGHT_MATCH = true",
"modifier": "private static final",
"original_strin... | {
"body": "public boolean eval(ContentFile<?> file) {\n // TODO: detect the case where a column is missing from the file using file's max field id.\n return new MetricsEvalVisitor().eval(file);\n }",
"class_method_signature": "InclusiveMetricsEvaluator.eval(ContentFile<?> file)",
"constructor": false,
"f... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_163 | {
"fields": [
{
"declarator": "meta = ImmutableMap.of()",
"modifier": "private static",
"original_string": "private static ImmutableMap<String, String> meta = ImmutableMap.of();",
"type": "ImmutableMap<String, String>",
"var_name": "meta"
}
],
"file": "core/src/test/java/org/... | {
"body": "@Test\n public void testLoadNamespaceMeta() throws IOException {\n Configuration conf = new Configuration();\n String warehousePath = temp.newFolder().getAbsolutePath();\n HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath);\n\n TableIdentifier tbl1 = TableIdentifier.of(\"db\", \"ns... | {
"fields": [
{
"declarator": "ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\"",
"modifier": "private static final",
"original_string": "private static final String ICEBERG_HADOOP_WAREHOUSE_BASE = \"iceberg/warehouse\";",
"type": "String",
"var_name": "ICEBERG_HADOOP_WAREHOUSE_... | {
"body": "@Override\n public Map<String, String> loadNamespaceMetadata(Namespace namespace) {\n Path nsPath = new Path(warehouseLocation, SLASH.join(namespace.levels()));\n\n if (!isNamespace(nsPath) || namespace.isEmpty()) {\n throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", namespac... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_14 | {
"fields": [
{
"declarator": "INTEGER_FIELD = \"i\"",
"modifier": "private static final",
"original_string": "private static final String INTEGER_FIELD = \"i\";",
"type": "String",
"var_name": "INTEGER_FIELD"
},
{
"declarator": "BOOLEAN_FIELD = \"b\"",
"modifier"... | {
"body": "@Test\n public void convertPrimitive() {\n Schema iceberg = new Schema(\n Types.NestedField.optional(0, INTEGER_FIELD, IntegerType.get()),\n Types.NestedField.optional(1, BOOLEAN_FIELD, BooleanType.get()),\n Types.NestedField.required(2, DOUBLE_FIELD, DoubleType.get()),\n Ty... | {
"fields": [
{
"declarator": "ORIGINAL_TYPE = \"originalType\"",
"modifier": "private static final",
"original_string": "private static final String ORIGINAL_TYPE = \"originalType\";",
"type": "String",
"var_name": "ORIGINAL_TYPE"
},
{
"declarator": "MAP_TYPE = \"mapTy... | {
"body": "public static Schema convert(final org.apache.iceberg.Schema schema) {\n ImmutableList.Builder<Field> fields = ImmutableList.builder();\n\n for (NestedField f : schema.columns()) {\n fields.add(convert(f));\n }\n\n return new Schema(fields.build());\n }",
"class_method_signature": "Arro... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_175 | {
"fields": [],
"file": "mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java",
"identifier": "TestHiveIcebergFilterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testStringType() {\n SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();\n SearchArgument arg = builder.startAnd().equals(\"string\", PredicateLeaf.Type.STRING, \"Joe\").end().build();\n\n UnboundPredicate expected = Expressions.equal(\"string\", \"Joe\");\n ... | {
"fields": [
{
"declarator": "LITERAL_FIELD = DynFields.builder()\n .hiddenImpl(SearchArgumentImpl.PredicateLeafImpl.class, \"literal\")\n .build()",
"modifier": "private static final",
"original_string": "private static final DynFields.UnboundField<?> LITERAL_FIELD = DynFields.builde... | {
"body": "public static Expression generateFilterExpression(SearchArgument sarg) {\n return translate(sarg.getExpression(), sarg.getLeaves());\n }",
"class_method_signature": "HiveIcebergFilterFactory.generateFilterExpression(SearchArgument sarg)",
"constructor": false,
"full_signature": "public static Exp... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
158256479_122 | {
"fields": [
{
"declarator": "SCHEMA = new Schema(\n required(1, \"id\", Types.IntegerType.get()),\n optional(2, \"data\", Types.StringType.get()),\n optional(3, \"preferences\", Types.StructType.of(\n required(8, \"feature1\", Types.BooleanType.get()),\n optional(9, \"feat... | {
"body": "@Test\n public void testMakeColumnOptional() {\n Schema schema = new Schema(required(1, \"id\", Types.IntegerType.get()));\n Schema expected = new Schema(optional(1, \"id\", Types.IntegerType.get()));\n\n Schema result = new SchemaUpdate(schema, 1)\n .makeColumnOptional(\"id\")\n .a... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SchemaUpdate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SchemaUpdate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "@Override\n public UpdateSchema makeColumnOptional(String name) {\n internalUpdateColumnRequirement(name, true);\n return this;\n }",
"class_method_signature": "SchemaUpdate.makeColumnOptional(String name)",
"constructor": false,
"full_signature": "@Override public UpdateSchema makeColumnOpti... | {
"created": "11/19/2018 4:26:46 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158256479,
"size": null,
"stargazer_count": null,
"stars": 316,
"updates": "2020-01-27T18:32:18+00:00",
"url": "https://github.com/apache/incubat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.