id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
166515022_1077 | {
"fields": [
{
"declarator": "LEFT_JOIN_COLUMN = \"left_join_column\"",
"modifier": "private static final",
"original_string": "private static final String LEFT_JOIN_COLUMN = \"left_join_column\";",
"type": "String",
"var_name": "LEFT_JOIN_COLUMN"
},
{
"declarator": "L... | {
"body": "@Test\n public void testJoinComplementStats()\n {\n PlanNodeStatsEstimate expected = planNodeStats(\n LEFT_ROWS_COUNT * (LEFT_JOIN_COLUMN_NULLS + LEFT_JOIN_COLUMN_NON_NULLS / 4),\n symbolStatistics(LEFT_JOIN_COLUMN, 0.0, 20.0, LEFT_JOIN_COLUMN_NULLS / (LEFT_JOIN_C... | {
"fields": [
{
"declarator": "PATTERN = join()",
"modifier": "private static final",
"original_string": "private static final Pattern<JoinNode> PATTERN = join();",
"type": "Pattern<JoinNode>",
"var_name": "PATTERN"
},
{
"declarator": "DEFAULT_UNMATCHED_JOIN_COMPLEMENT_... | {
"body": "@VisibleForTesting\n PlanNodeStatsEstimate calculateJoinComplementStats(\n Optional<Expression> filter,\n List<JoinNode.EquiJoinClause> criteria,\n PlanNodeStatsEstimate leftStats,\n PlanNodeStatsEstimate rightStats,\n TypeProvider types)\n {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1132 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/execution/TestDynamicFiltersCollector.java",
"identifier": "TestDynamicFiltersCollector",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDynamicFiltersCollector()\n {\n DynamicFilterId filter = new DynamicFilterId(\"filter\");\n DynamicFiltersCollector collector = new DynamicFiltersCollector(() -> {});\n\n VersionedDynamicFilterDomains domains = collector.acknowledgeAndGetNewDomains(INITIAL... | {
"fields": [
{
"declarator": "INITIAL_DYNAMIC_FILTERS_VERSION = 0L",
"modifier": "public static final",
"original_string": "public static final long INITIAL_DYNAMIC_FILTERS_VERSION = 0L;",
"type": "long",
"var_name": "INITIAL_DYNAMIC_FILTERS_VERSION"
},
{
"declarator":... | {
"body": "public DynamicFiltersCollector(Runnable notifyTaskStatusChanged)\n {\n this.notifyTaskStatusChanged = requireNonNull(notifyTaskStatusChanged, \"notifyTaskStatusChanged is null\");\n }",
"class_method_signature": "DynamicFiltersCollector.DynamicFiltersCollector(Runnable notifyTaskStatusChange... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1098 | {
"fields": [
{
"declarator": "BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(BOOLEAN))",
"modifier": "private static final",
"original_string": "private static final Function<String, Column> BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(B... | {
"body": "@Test\n public void shouldAcceptNullColumnsAndTypes()\n {\n queryResultRowsBuilder(getSession())\n .withColumnsAndTypes(null, null)\n .build();\n }",
"class_method_signature": "TestQueryResultRows.shouldAcceptNullColumnsAndTypes()",
"constructor": false,
... | {
"fields": [
{
"declarator": "session",
"modifier": "private final",
"original_string": "private final ConnectorSession session;",
"type": "ConnectorSession",
"var_name": "session"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string"... | {
"body": "public static Builder queryResultRowsBuilder(Session session)\n {\n return new Builder(session);\n }",
"class_method_signature": "QueryResultRows.queryResultRowsBuilder(Session session)",
"constructor": false,
"full_signature": "public static Builder queryResultRowsBuilder(Session sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_228 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testTemporalColumnTableCreation()\n {\n long tableId = createTable(\"test\");\n List<ColumnInfo> columns = ImmutableList.of(new ColumnInfo(1, TIMESTAMP_MILLIS));\n shardManager.createTable(tableId, columns, false, OptionalLong.of(1));\n\n long tableId2 ... | {
"fields": [
{
"declarator": "log = Logger.get(DatabaseShardManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(DatabaseShardManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "INDE... | {
"body": "@Override\n public void createTable(long tableId, List<ColumnInfo> columns, boolean bucketed, OptionalLong temporalColumnId)\n {\n StringJoiner tableColumns = new StringJoiner(\",\\n \", \" \", \",\\n\").setEmptyValue(\"\");\n\n for (ColumnInfo column : columns) {\n String ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_382 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTCentroid()\n {\n assertFunction(\"ST_AsText(ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY')))\", VARCHAR, \"POINT EMPTY\");\n assertFunction(\"ST_AsText(ST_Centroid(ST_GeometryFromText('POINT (3 5)')))\", VARCHAR, \"POINT (3 5)\");\n assertFunction(\... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns the Point value that is the mathematical centroid of a Geometry\")\n @ScalarFunction(\"ST_Centroid\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = deserialize(input);\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_678 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "re2jType = metadata.g... | {
"body": "@Test\n public void testCanCoerceIsTransitive()\n {\n Set<Type> types = getStandardPrimitiveTypes();\n for (Type transitiveType : types) {\n for (Type resultType : types) {\n if (typeCoercion.canCoerce(transitiveType, resultType)) {\n for (Ty... | {
"fields": [
{
"declarator": "lookupType",
"modifier": "private final",
"original_string": "private final Function<TypeSignature, Type> lookupType;",
"type": "Function<TypeSignature, Type>",
"var_name": "lookupType"
}
],
"file": "presto-main/src/main/java/io/prestosql/type/T... | {
"body": "public boolean canCoerce(Type fromType, Type toType)\n {\n TypeCompatibility typeCompatibility = compatibility(fromType, toType);\n return typeCompatibility.isCoercible();\n }",
"class_method_signature": "TypeCoercion.canCoerce(Type fromType, Type toType)",
"constructor": false,
"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_802 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testSha512()\n {\n assertFunction(\"sha512(CAST('' AS VARBINARY))\", VARBINARY, sqlVarbinaryFromHex(\"CF83E1357EEFB8BDF1542850D66D8007D620E4050B5715DC83F4A921D36CE9CE47D0D13C5D85F2B0FF8318D2877EEC2F63B931BD47417A81A538327AF927DA3E\"));\n assertFunction(\"sha512(CAST(... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Compute sha512 hash\")\n @ScalarFunction\n @SqlType(StandardTypes.VARBINARY)\n public static Slice sha512(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n return computeHash(Hashing.sha512(), slice);\n }",
"class_method_signature": "VarbinaryFunctions.sha512(@SqlT... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_77 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBigintConversion()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addBigintValues(\"col1\", Long.MAX_VALUE)\n .build();\n String expression = buildGlueExpression(ImmutableList.of(\"col1\"), filter, true);\n ... | {
"fields": [
{
"declarator": "NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\"",
"modifier": "static final",
"original_string": "static final String NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\";",
"type": "String",
"var_name": "NULL_STRING"
},
{
"declarator": "GLUE_EXPRESS... | {
"body": "public static String buildGlueExpression(List<String> columnNames, TupleDomain<String> partitionKeysFilter, boolean assumeCanonicalPartitionKeys)\n {\n return buildGlueExpression(columnNames, partitionKeysFilter, assumeCanonicalPartitionKeys, GLUE_EXPRESSION_CHAR_LIMIT);\n }",
"class_method_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_551 | {
"fields": [
{
"declarator": "POSITIONS_PER_PAGE = 0",
"modifier": "private static final",
"original_string": "private static final int POSITIONS_PER_PAGE = 0;",
"type": "int",
"var_name": "POSITIONS_PER_PAGE"
},
{
"declarator": "pagesStore",
"modifier": "private... | {
"body": "@Test(expectedExceptions = PrestoException.class)\n public void testTryToReadFromEmptyTable()\n {\n createTable(0L, 0L);\n assertEquals(pagesStore.getPages(0L, 0, 1, ImmutableList.of(0), 0, OptionalLong.empty(), OptionalDouble.empty()), ImmutableList.of());\n pagesStore.getPages(... | {
"fields": [
{
"declarator": "maxBytes",
"modifier": "private final",
"original_string": "private final long maxBytes;",
"type": "long",
"var_name": "maxBytes"
},
{
"declarator": "currentBytes",
"modifier": "@GuardedBy(\"this\")\n private",
"original_str... | {
"body": "public synchronized List<Page> getPages(\n Long tableId,\n int partNumber,\n int totalParts,\n List<Integer> columnIndexes,\n long expectedRows,\n OptionalLong limit,\n OptionalDouble sampleRatio)\n {\n if (!contains(tab... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_101 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/thrift/TestThriftMetastoreUtil.java",
"identifier": "TestThriftMetastoreUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSingleDistinctValue()\n {\n DoubleColumnStatsData doubleColumnStatsData = new DoubleColumnStatsData();\n doubleColumnStatsData.setNumNulls(10);\n doubleColumnStatsData.setNumDVs(1);\n ColumnStatisticsObj columnStatisticsObj = new ColumnStatisticsObj... | {
"fields": [
{
"declarator": "PUBLIC_ROLE_NAME = \"public\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_ROLE_NAME = \"public\";",
"type": "String",
"var_name": "PUBLIC_ROLE_NAME"
},
{
"declarator": "ADMIN_ROLE_NAME = \"a... | {
"body": "public static HiveColumnStatistics fromMetastoreApiColumnStatistics(ColumnStatisticsObj columnStatistics, OptionalLong rowCount)\n {\n if (columnStatistics.getStatsData().isSetLongStats()) {\n LongColumnStatsData longStatsData = columnStatistics.getStatsData().getLongStats();\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_414 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testGreatCircleDistance()\n {\n assertFunction(\"great_circle_distance(36.12, -86.67, 33.94, -118.40)\", DOUBLE, 2886.4489734367016);\n assertFunction(\"great_circle_distance(33.94, -118.40, 36.12, -86.67)\", DOUBLE, 2886.4489734367016);\n assertFunction(\"gre... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@ScalarFunction\n @Description(\"Calculates the great-circle distance between two points on the Earth's surface in kilometers\")\n @SqlType(DOUBLE)\n public static double greatCircleDistance(\n @SqlType(DOUBLE) double latitude1,\n @SqlType(DOUBLE) double longitude1,\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_98 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/TestMetastoreTypeConfig.java",
"identifier": "TestMetastoreTypeConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"hive.metastore\", \"foo\")\n .build();\n\n MetastoreTypeConfig expected = new MetastoreTypeConfig()\n ... | {
"fields": [
{
"declarator": "metastoreType = \"thrift\"",
"modifier": "private",
"original_string": "private String metastoreType = \"thrift\";",
"type": "String",
"var_name": "metastoreType"
}
],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/Metasto... | {
"body": "@Config(\"hive.metastore\")\n public MetastoreTypeConfig setMetastoreType(String metastoreType)\n {\n this.metastoreType = metastoreType;\n return this;\n }",
"class_method_signature": "MetastoreTypeConfig.setMetastoreType(String metastoreType)",
"constructor": false,
"full_sig... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_947 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestRemoveRedundantExists.java",
"identifier": "TestRemoveRedundantExists",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testDoesNotFire()\n {\n tester().assertThat(new RemoveRedundantExists())\n .on(p -> p.apply(Assignments.of(p.symbol(\"exists\"), new ExistsPredicate(TRUE_LITERAL)),\n ImmutableList.of(),\n p.values(1),\n ... | {
"fields": [
{
"declarator": "PATTERN = applyNode()\n .matching(node -> node.getSubqueryAssignments()\n .getExpressions().stream()\n .allMatch(expression -> expression instanceof ExistsPredicate && ((ExistsPredicate) expression).getSubquery().equals(TRUE_LIT... | {
"body": "@Override\n public Result apply(ApplyNode node, Captures captures, Context context)\n {\n Assignments.Builder assignments = Assignments.builder();\n assignments.putIdentities(node.getInput().getOutputSymbols());\n\n Expression result;\n if (QueryCardinalityUtil.isEmpty(nod... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1061 | {
"fields": [
{
"declarator": "TPCH_CATALOG = \"tpch\"",
"modifier": "private static final",
"original_string": "private static final String TPCH_CATALOG = \"tpch\";",
"type": "String",
"var_name": "TPCH_CATALOG"
},
{
"declarator": "TPCH_CATALOG_NAME = new CatalogName(T... | {
"body": "@Test\n public void testNotNullInJoinClause()\n {\n analyze(\"SELECT * FROM (VALUES (1)) a (x) JOIN (VALUES (2)) b ON a.x IS NOT NULL\");\n }",
"class_method_signature": "TestAnalyzer.testNotNullInJoinClause()",
"constructor": false,
"full_signature": "@Test public void testNotNullInJ... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private final",
"original_string": "private final Metadata metadata;",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "sqlParser",
"modifier": "private final",
"original_string": "private ... | {
"body": "public Analysis analyze(Statement statement)\n {\n return analyze(statement, false);\n }",
"class_method_signature": "Analyzer.analyze(Statement statement)",
"constructor": false,
"full_signature": "public Analysis analyze(Statement statement)",
"identifier": "analyze",
"invocations"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_681 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestIntegerOperators.java",
"identifier": "TestIntegerOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testAdd()\n {\n assertFunction(\"INTEGER'37' + INTEGER'37'\", INTEGER, 37 + 37);\n assertFunction(\"INTEGER'37' + INTEGER'17'\", INTEGER, 37 + 17);\n assertFunction(\"INTEGER'17' + INTEGER'37'\", INTEGER, 17 + 37);\n assertFunction(\"INTEGER'17' + INTEG... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/IntegerOperators.java",
"identifier": "IntegerOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "IntegerOperators.IntegerOperators()",
"constructor": true,
"full_signature": "private IntegerOperato... | {
"body": "@ScalarOperator(ADD)\n @SqlType(StandardTypes.INTEGER)\n public static long add(@SqlType(StandardTypes.INTEGER) long left, @SqlType(StandardTypes.INTEGER) long right)\n {\n try {\n return Math.addExact((int) left, (int) right);\n }\n catch (ArithmeticException e) {\... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_394 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTNumPoints()\n {\n assertNumPoints(\"POINT EMPTY\", 0);\n assertNumPoints(\"MULTIPOINT EMPTY\", 0);\n assertNumPoints(\"LINESTRING EMPTY\", 0);\n assertNumPoints(\"MULTILINESTRING EMPTY\", 0);\n assertNumPoints(\"POLYGON EMPTY\", 0);\n ... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns the number of points in a Geometry\")\n @ScalarFunction(\"ST_NumPoints\")\n @SqlType(BIGINT)\n public static long stNumPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n return getPointCount(deserialize(input));\n }",
"class_method_signature": "GeoFunction... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1124 | {
"fields": [
{
"declarator": "client",
"modifier": "private",
"original_string": "private HttpClient client;",
"type": "HttpClient",
"var_name": "client"
},
{
"declarator": "server",
"modifier": "private",
"original_string": "private TestingPrestoServer ser... | {
"body": "@Test\n public void testGetQueryInfoExecutionFailure()\n {\n String queryId = runToCompletion(\"SELECT cast(rand() AS integer) / 0\");\n QueryInfo info = getQueryInfo(queryId);\n assertTrue(info.isScheduled());\n assertNotNull(info.getFailureInfo());\n assertEquals(... | {
"fields": [
{
"declarator": "dispatchManager",
"modifier": "private final",
"original_string": "private final DispatchManager dispatchManager;",
"type": "DispatchManager",
"var_name": "dispatchManager"
},
{
"declarator": "accessControl",
"modifier": "private fin... | {
"body": "@ResourceSecurity(AUTHENTICATED_USER)\n @GET\n @Path(\"{queryId}\")\n public Response getQueryInfo(@PathParam(\"queryId\") QueryId queryId, @Context HttpServletRequest servletRequest, @Context HttpHeaders httpHeaders)\n {\n requireNonNull(queryId, \"queryId is null\");\n\n Optiona... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_117 | {
"fields": [
{
"declarator": "IDENTITY = new HiveIdentity(SESSION)",
"modifier": "private static final",
"original_string": "private static final HiveIdentity IDENTITY = new HiveIdentity(SESSION);",
"type": "HiveIdentity",
"var_name": "IDENTITY"
},
{
"declarator": "TES... | {
"body": "@Test\n public void testGetPartitionStatistics()\n {\n assertEquals(mockClient.getAccessCount(), 0);\n\n Table table = metastore.getTable(IDENTITY, TEST_DATABASE, TEST_TABLE).get();\n assertEquals(mockClient.getAccessCount(), 1);\n\n Partition partition = metastore.getPart... | {
"fields": [
{
"declarator": "delegate",
"modifier": "protected final",
"original_string": "protected final HiveMetastore delegate;",
"type": "HiveMetastore",
"var_name": "delegate"
},
{
"declarator": "databaseCache",
"modifier": "private final",
"original_... | {
"body": "@Override\n public Map<String, PartitionStatistics> getPartitionStatistics(HiveIdentity identity, Table table, List<Partition> partitions)\n {\n HiveTableName hiveTableName = hiveTableName(table.getDatabaseName(), table.getTableName());\n List<WithIdentity<HivePartitionName>> partitionN... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_547 | {
"fields": [
{
"declarator": "POSITIONS_PER_PAGE = 0",
"modifier": "private static final",
"original_string": "private static final int POSITIONS_PER_PAGE = 0;",
"type": "int",
"var_name": "POSITIONS_PER_PAGE"
},
{
"declarator": "pagesStore",
"modifier": "private... | {
"body": "@Test\n public void testCreateEmptyTable()\n {\n createTable(0L, 0L);\n assertEquals(pagesStore.getPages(0L, 0, 1, ImmutableList.of(0), 0, OptionalLong.empty(), OptionalDouble.empty()), ImmutableList.of());\n }",
"class_method_signature": "TestMemoryPagesStore.testCreateEmptyTable(... | {
"fields": [
{
"declarator": "maxBytes",
"modifier": "private final",
"original_string": "private final long maxBytes;",
"type": "long",
"var_name": "maxBytes"
},
{
"declarator": "currentBytes",
"modifier": "@GuardedBy(\"this\")\n private",
"original_str... | {
"body": "public synchronized List<Page> getPages(\n Long tableId,\n int partNumber,\n int totalParts,\n List<Integer> columnIndexes,\n long expectedRows,\n OptionalLong limit,\n OptionalDouble sampleRatio)\n {\n if (!contains(tab... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_61 | {
"fields": [
{
"declarator": "typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators())",
"modifier": "private final",
"original_string": "private final TypeManager typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators());",
"ty... | {
"body": "@Test\n public void testNotPushDoublePredicates()\n {\n IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(typeManager);\n List<HiveColumnHandle> columns = ImmutableList.of(\n createBaseColumn(\"quantity\", 0, HIVE_INT, INTEGER, REGULAR, Optional.empty()),\n ... | {
"fields": [
{
"declarator": "FORMATTER = date().withChronology(getInstanceUTC())",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter FORMATTER = date().withChronology(getInstanceUTC());",
"type": "DateTimeFormatter",
"var_name": "FORMATT... | {
"body": "public String buildSql(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> tupleDomain)\n {\n columns.forEach(column -> checkArgument(column.isBaseColumn(), \"%s is not a base column\", column));\n tupleDomain.getDomains().ifPresent(domains -> {\n domains.keySet().forE... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_814 | {
"fields": [
{
"declarator": "DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0}",
"modifier": "private static final",
"original_string": "private static final double[] DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0};",
"type": "double[]",
"var_name": "DOUBLE_VALUES"
},
{
... | {
"body": "@Test\n public void testCos()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"cos(\" + doubleValue + \")\", DOUBLE, Math.cos(doubleValue));\n assertFunction(\"cos(REAL '\" + (float) doubleValue + \"')\", DOUBLE, Math.cos((float) doubleValue));\n ... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Cosine\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double cos(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.cos(num);\n }",
"class_method_signature": "MathFunctions.cos(@SqlType(StandardTypes.DOUBLE) double num)",
"constructo... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_951 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestTransformUncorrelatedInPredicateSubqueryToSemiJoin.java",
"identifier": "TestTransformUncorrelatedInPredicateSubqueryToSemiJoin",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testFiresForInPredicate()\n {\n tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToSemiJoin())\n .on(p -> p.apply(\n Assignments.of(\n p.symbol(\"x\"),\n new I... | {
"fields": [
{
"declarator": "PATTERN = applyNode()\n .with(empty(correlation()))",
"modifier": "private static final",
"original_string": "private static final Pattern<ApplyNode> PATTERN = applyNode()\n .with(empty(correlation()));",
"type": "Pattern<ApplyNode>",
... | {
"body": "@Override\n public Result apply(ApplyNode applyNode, Captures captures, Context context)\n {\n if (applyNode.getSubqueryAssignments().size() != 1) {\n return Result.empty();\n }\n\n Expression expression = getOnlyElement(applyNode.getSubqueryAssignments().getExpression... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_402 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTExteriorRing()\n {\n assertFunction(\"ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON EMPTY')))\", VARCHAR, null);\n assertFunction(\"ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 1))')))\", VARCHAR, \"LINESTRING (1 1, 4 1, 1 4, 1 ... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@SqlNullable\n @Description(\"Returns a line string representing the exterior ring of the POLYGON\")\n @ScalarFunction(\"ST_ExteriorRing\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stExteriorRing(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = deseri... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_286 | {
"fields": [],
"file": "presto-thrift-api/src/test/java/io/prestosql/plugin/thrift/api/datatypes/TestPrestoThriftBigint.java",
"identifier": "TestPrestoThriftBigint",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadBlockAllNullsOption2()\n {\n PrestoThriftBlock columnsData = longColumn(\n new boolean[] {true, true, true, true, true, true, true},\n new long[] {0, 0, 0, 0, 0, 0, 0});\n Block actual = columnsData.toBlock(BIGINT);\n asse... | {
"fields": [
{
"declarator": "nulls",
"modifier": "private final",
"original_string": "private final boolean[] nulls;",
"type": "boolean[]",
"var_name": "nulls"
},
{
"declarator": "longs",
"modifier": "private final",
"original_string": "private final long[... | {
"body": "@Override\n public Block toBlock(Type desiredType)\n {\n checkArgument(BIGINT.equals(desiredType), \"type doesn't match: %s\", desiredType);\n int numberOfRecords = numberOfRecords();\n return new LongArrayBlock(\n numberOfRecords,\n Optional.ofNulla... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1036 | {
"fields": [
{
"declarator": "TPCH_CATALOG = \"tpch\"",
"modifier": "private static final",
"original_string": "private static final String TPCH_CATALOG = \"tpch\";",
"type": "String",
"var_name": "TPCH_CATALOG"
},
{
"declarator": "TPCH_CATALOG_NAME = new CatalogName(T... | {
"body": "@Test\n public void testStartTransaction()\n {\n analyze(\"START TRANSACTION\");\n analyze(\"START TRANSACTION ISOLATION LEVEL READ UNCOMMITTED\");\n analyze(\"START TRANSACTION ISOLATION LEVEL READ COMMITTED\");\n analyze(\"START TRANSACTION ISOLATION LEVEL REPEATABLE REA... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private final",
"original_string": "private final Metadata metadata;",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "sqlParser",
"modifier": "private final",
"original_string": "private ... | {
"body": "public Analysis analyze(Statement statement)\n {\n return analyze(statement, false);\n }",
"class_method_signature": "Analyzer.analyze(Statement statement)",
"constructor": false,
"full_signature": "public Analysis analyze(Statement statement)",
"identifier": "analyze",
"invocations"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1173 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testStartTransaction()\n {\n Session session = sessionBuilder()\n .setClientTransactionSupport()\n .build();\n TransactionManager transactionManager = createTestTransactionManager();\n QueryStateMachine stateMachine = createQueryS... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/StartTransactionTask.java",
"identifier": "StartTransactionTask",
"interfaces": "implements DataDefinitionTask<StartTransaction>",
"methods": [
{
"class_method_signature": "StartTransactionTask.getName()",
"constructor":... | {
"body": "@Override\n public ListenableFuture<?> execute(StartTransaction statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (!sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_793 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testToBigEndian32()\n {\n assertFunction(\"to_big_endian_32(0)\", VARBINARY, sqlVarbinaryFromHex(\"00000000\"));\n assertFunction(\"to_big_endian_32(1)\", VARBINARY, sqlVarbinaryFromHex(\"00000001\"));\n assertFunction(\"to_big_endian_32(2147483647)\", VARBINA... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Encode value as a 32-bit 2's complement big endian varbinary\")\n @ScalarFunction(\"to_big_endian_32\")\n @SqlType(StandardTypes.VARBINARY)\n public static Slice toBigEndian32(@SqlType(StandardTypes.INTEGER) long value)\n {\n Slice slice = Slices.allocate(Integer.BYTES);\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_269 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testSimple()\n {\n long timestamp = 1L;\n int day = 1;\n\n List<ShardIndexInfo> shards = ImmutableList.of(\n shardWithSortRange(1, ShardRange.of(new Tuple(types, 5L, \"hello\", day, timestamp), new Tuple(types, 10L, \"hello\", day, timestamp))),... | {
"fields": [
{
"declarator": "log = Logger.get(ShardOrganizationManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(ShardOrganizationManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@VisibleForTesting\n static Set<OrganizationSet> createOrganizationSets(Table tableInfo, Collection<ShardIndexInfo> shards)\n {\n return getShardsByDaysBuckets(tableInfo, shards).stream()\n .map(indexInfos -> getOverlappingOrganizationSets(tableInfo, indexInfos))\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_639 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestDoubleOperators.java",
"identifier": "TestDoubleOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testDivide()\n {\n assertFunction(\"37.7E0 / 37.7E0\", DOUBLE, 37.7 / 37.7);\n assertFunction(\"37.7E0 / 17.1E0\", DOUBLE, 37.7 / 17.1);\n assertFunction(\"17.1E0 / 37.7E0\", DOUBLE, 17.1 / 37.7);\n assertFunction(\"17.1E0 / 17.1E0\", DOUBLE, 17.1 / 17.... | {
"fields": [
{
"declarator": "MIN_INTEGER_AS_DOUBLE = -0x1p31",
"modifier": "private static final",
"original_string": "private static final double MIN_INTEGER_AS_DOUBLE = -0x1p31;",
"type": "double",
"var_name": "MIN_INTEGER_AS_DOUBLE"
},
{
"declarator": "MAX_INTEGER_... | {
"body": "@ScalarOperator(DIVIDE)\n @SqlType(StandardTypes.DOUBLE)\n public static double divide(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right)\n {\n return left / right;\n }",
"class_method_signature": "DoubleOperators.divide(@SqlType(StandardTypes.DOUB... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_36 | {
"fields": [
{
"declarator": "alice = Identity.forUser(\"alice\").withGroups(ImmutableSet.of(\"staff\")).build()",
"modifier": "private static final",
"original_string": "private static final Identity alice = Identity.forUser(\"alice\").withGroups(ImmutableSet.of(\"staff\")).build();",
"t... | {
"body": "@Test\n public void testTableRulesForCheckCanDropColumn()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanDropColumn(ADMIN, new CatalogSchemaTableName(\"some-catalog\", \"bobschema\", \"bobtabl... | {
"fields": [
{
"declarator": "log = Logger.get(FileBasedSystemAccessControl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(FileBasedSystemAccessControl.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@Override\n public void checkCanDropColumn(SystemSecurityContext context, CatalogSchemaTableName table)\n {\n if (!checkTablePermission(context, table, OWNERSHIP)) {\n denyDropColumn(table.toString());\n }\n }",
"class_method_signature": "FileBasedSystemAccessControl.che... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_843 | {
"fields": [
{
"declarator": "DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0}",
"modifier": "private static final",
"original_string": "private static final double[] DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0};",
"type": "double[]",
"var_name": "DOUBLE_VALUES"
},
{
... | {
"body": "@Test\n public void testCosineSimilarity()\n {\n assertFunction(\"cosine_similarity(map(array ['a', 'b'], array [1.0E0, 2.0E0]), map(array ['c', 'b'], array [1.0E0, 3.0E0]))\",\n DOUBLE,\n 2 * 3 / (Math.sqrt(5) * Math.sqrt(10)));\n\n assertFunction(\"cosine... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Cosine similarity between the given sparse vectors\")\n @ScalarFunction\n @SqlNullable\n @SqlType(StandardTypes.DOUBLE)\n public static Double cosineSimilarity(\n @OperatorDependency(\n operator = EQUAL,\n argumentTypes = {\"varcha... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_510 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestClientOptions.java",
"identifier": "TestClientOptions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSource()\n {\n Console console = createConsole(\"--source=test\");\n ClientSession session = console.clientOptions.toClientSession();\n assertEquals(session.getSource(), \"test\");\n }",
"class_method_signature": "TestClientOptions.testSource()",
"c... | {
"fields": [
{
"declarator": "NAME_VALUE_SPLITTER = Splitter.on('=').limit(2)",
"modifier": "private static final",
"original_string": "private static final Splitter NAME_VALUE_SPLITTER = Splitter.on('=').limit(2);",
"type": "Splitter",
"var_name": "NAME_VALUE_SPLITTER"
},
{... | {
"body": "public ClientSession toClientSession()\n {\n return new ClientSession(\n parseServer(server),\n user,\n source,\n Optional.ofNullable(traceToken),\n parseClientTags(nullToEmpty(clientTags)),\n clientInfo,\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_140 | {
"fields": [
{
"declarator": "TABLE = new SchemaTableName(\"schema\", \"table\")",
"modifier": "private static final",
"original_string": "private static final SchemaTableName TABLE = new SchemaTableName(\"schema\", \"table\");",
"type": "SchemaTableName",
"var_name": "TABLE"
},... | {
"body": "@Test\n public void testCalculateDistinctValuesCount()\n {\n assertEquals(calculateDistinctValuesCount(ImmutableList.of()), Estimate.unknown());\n assertEquals(calculateDistinctValuesCount(ImmutableList.of(HiveColumnStatistics.empty())), Estimate.unknown());\n assertEquals(calcul... | {
"fields": [
{
"declarator": "log = Logger.get(MetastoreHiveStatisticsProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(MetastoreHiveStatisticsProvider.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n static Estimate calculateDistinctValuesCount(List<HiveColumnStatistics> columnStatistics)\n {\n return columnStatistics.stream()\n .map(MetastoreHiveStatisticsProvider::getDistinctValuesCount)\n .filter(OptionalLong::isPresent)\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_455 | {
"fields": [
{
"declarator": "MAX_DECIMAL = unscaledDecimal(MAX_DECIMAL_UNSCALED_VALUE)",
"modifier": "private static final",
"original_string": "private static final Slice MAX_DECIMAL = unscaledDecimal(MAX_DECIMAL_UNSCALED_VALUE);",
"type": "Slice",
"var_name": "MAX_DECIMAL"
},... | {
"body": "@Test\n public void testCompare()\n {\n assertCompare(unscaledDecimal(0), unscaledDecimal(0), 0);\n assertCompare(negate(unscaledDecimal(0)), unscaledDecimal(0), 0);\n assertCompare(unscaledDecimal(0), negate(unscaledDecimal(0)), 0);\n\n assertCompare(unscaledDecimal(0), u... | {
"fields": [
{
"declarator": "NUMBER_OF_LONGS = 2",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_LONGS = 2;",
"type": "int",
"var_name": "NUMBER_OF_LONGS"
},
{
"declarator": "NUMBER_OF_INTS = 2 * NUMBER_OF_LONGS",
"mo... | {
"body": "public static int compare(Slice left, Slice right)\n {\n boolean leftStrictlyNegative = isStrictlyNegative(left);\n boolean rightStrictlyNegative = isStrictlyNegative(right);\n\n if (leftStrictlyNegative != rightStrictlyNegative) {\n return leftStrictlyNegative ? -1 : 1;\... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_906 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGroupedDoubleThenDouble()\n {\n List<LocalProperty<String>> actual = builder()\n .grouped(\"a\", \"b\")\n .grouped(\"c\", \"a\")\n .build();\n\n assertMatch(\n actual,\n builder().grouped(... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/optimizations/LocalProperties.java",
"identifier": "LocalProperties",
"interfaces": "",
"methods": [
{
"class_method_signature": "LocalProperties.LocalProperties()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static <T> List<LocalProperty<T>> grouped(Collection<T> columns)\n {\n return ImmutableList.of(new GroupingProperty<>(columns));\n }",
"class_method_signature": "LocalProperties.grouped(Collection<T> columns)",
"constructor": false,
"full_signature": "public static List<LocalPrope... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1108 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/TestPrestoSystemRequirements.java",
"identifier": "TestPrestoSystemRequirements",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSystemTimeSanityCheck()\n {\n verifySystemTimeIsReasonable();\n }",
"class_method_signature": "TestPrestoSystemRequirements.testSystemTimeSanityCheck()",
"constructor": false,
"full_signature": "@Test public void testSystemTimeSanityCheck()",
"identifier": "t... | {
"fields": [
{
"declarator": "MIN_FILE_DESCRIPTORS = 4096",
"modifier": "private static final",
"original_string": "private static final int MIN_FILE_DESCRIPTORS = 4096;",
"type": "int",
"var_name": "MIN_FILE_DESCRIPTORS"
},
{
"declarator": "RECOMMENDED_FILE_DESCRIPTOR... | {
"body": "public static void verifySystemTimeIsReasonable()\n {\n int currentYear = DateTime.now().year().get();\n if (currentYear < 2019) {\n failRequirement(\"Presto requires the system time to be current (found year %s)\", currentYear);\n }\n }",
"class_method_signature": "... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_212 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/backup/TestHttpBackupConfig.java",
"identifier": "TestHttpBackupConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(HttpBackupConfig.class)\n .setUri(null));\n }",
"class_method_signature": "TestHttpBackupConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public void testDefaults()",
... | {
"fields": [
{
"declarator": "uri",
"modifier": "private",
"original_string": "private URI uri;",
"type": "URI",
"var_name": "uri"
}
],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/backup/HttpBackupConfig.java",
"identifier": "HttpBackupCon... | {
"body": "@Config(\"backup.http.uri\")\n @ConfigDescription(\"Backup service base URI\")\n public HttpBackupConfig setUri(URI uri)\n {\n this.uri = uri;\n return this;\n }",
"class_method_signature": "HttpBackupConfig.setUri(URI uri)",
"constructor": false,
"full_signature": "@Config(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_642 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestDoubleOperators.java",
"identifier": "TestDoubleOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToBoolean()\n {\n assertFunction(\"cast(37.7E0 as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(17.1E0 as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(0.0E0 as boolean)\", BOOLEAN, false);\n assertFunction(\"cast(nan() as boolean)\"... | {
"fields": [
{
"declarator": "MIN_INTEGER_AS_DOUBLE = -0x1p31",
"modifier": "private static final",
"original_string": "private static final double MIN_INTEGER_AS_DOUBLE = -0x1p31;",
"type": "double",
"var_name": "MIN_INTEGER_AS_DOUBLE"
},
{
"declarator": "MAX_INTEGER_... | {
"body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean castToBoolean(@SqlType(StandardTypes.DOUBLE) double value)\n {\n return value != 0;\n }",
"class_method_signature": "DoubleOperators.castToBoolean(@SqlType(StandardTypes.DOUBLE) double value)",
"construct... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_357 | {
"fields": [],
"file": "presto-parser/src/test/java/io/prestosql/type/TestTypeCalculation.java",
"identifier": "TestTypeCalculation",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasicUsage()\n {\n assertEquals(calculateLiteralValue(\"42\", ImmutableMap.of()), Long.valueOf(42));\n assertEquals(calculateLiteralValue(\"NULL\", ImmutableMap.of()), Long.valueOf(0));\n assertEquals(calculateLiteralValue(\"null\", ImmutableMap.of()), Lon... | {
"fields": [
{
"declarator": "ERROR_LISTENER = new BaseErrorListener()\n {\n @Override\n public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String message, RecognitionException e)\n {\n throw new ParsingException... | {
"body": "public static Long calculateLiteralValue(\n String calculation,\n Map<String, Long> inputs)\n {\n try {\n ParserRuleContext tree = parseTypeCalculation(calculation);\n CalculateTypeVisitor visitor = new CalculateTypeVisitor(inputs);\n BigInte... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_707 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/security/TestAccessControlConfig.java",
"identifier": "TestAccessControlConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n ConfigAssertions.assertRecordedDefaults(ConfigAssertions.recordDefaults(AccessControlConfig.class)\n .setAccessControlFiles(\"\"));\n }",
"class_method_signature": "TestAccessControlConfig.testDefaults()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings()",
"modifier": "private static final",
"original_string": "private static final Splitter SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings();",
"type": "Splitter",
"var_name": "SPLITTE... | {
"body": "@Config(\"access-control.config-files\")\n public AccessControlConfig setAccessControlFiles(String accessControlFiles)\n {\n this.accessControlFiles = SPLITTER.splitToList(accessControlFiles).stream()\n .map(File::new)\n .collect(toImmutableList());\n retur... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_584 | {
"fields": [],
"file": "presto-base-jdbc/src/test/java/io/prestosql/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java",
"identifier": "TestConfigFileBasedCredentialProviderConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(ConfigFileBasedCredentialProviderConfig.class)\n .setCredentialFile(null));\n }",
"class_method_signature": "TestConfigFileBasedCredentialProviderConfig.testDefaults()",
"constructor": false,
... | {
"fields": [
{
"declarator": "credentialsFile",
"modifier": "private",
"original_string": "private String credentialsFile;",
"type": "String",
"var_name": "credentialsFile"
}
],
"file": "presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/credential/file/ConfigFileBasedC... | {
"body": "@Config(\"connection-credential-file\")\n @ConfigDescription(\"Location of the file where credentials are present\")\n public ConfigFileBasedCredentialProviderConfig setCredentialFile(String connectionUser)\n {\n this.credentialsFile = connectionUser;\n return this;\n }",
"class... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_992 | {
"fields": [
{
"declarator": "A = new Symbol(\"a\")",
"modifier": "private static final",
"original_string": "private static final Symbol A = new Symbol(\"a\");",
"type": "Symbol",
"var_name": "A"
},
{
"declarator": "B = new Symbol(\"b\")",
"modifier": "private s... | {
"body": "@Test\n public void testInnerJoin()\n {\n ImmutableList.Builder<JoinNode.EquiJoinClause> criteriaBuilder = ImmutableList.builder();\n criteriaBuilder.add(new JoinNode.EquiJoinClause(A, D));\n criteriaBuilder.add(new JoinNode.EquiJoinClause(B, E));\n List<JoinNode.EquiJoinC... | {
"fields": [
{
"declarator": "SYMBOL_MATCHES_EXPRESSION =\n entry -> entry.getValue().equals(entry.getKey().toSymbolReference())",
"modifier": "private static final",
"original_string": "private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION... | {
"body": "public Expression extract(Session session, PlanNode node, TypeProvider types, TypeAnalyzer typeAnalyzer)\n {\n return node.accept(new Visitor(domainTranslator, metadata, session, types, typeAnalyzer, useTableProperties), null);\n }",
"class_method_signature": "EffectivePredicateExtractor.ext... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1221 | {
"fields": [
{
"declarator": "OUT = new OutputBufferId(0)",
"modifier": "public static final",
"original_string": "public static final OutputBufferId OUT = new OutputBufferId(0);",
"type": "OutputBufferId",
"var_name": "OUT"
},
{
"declarator": "CONNECTOR_ID = TEST_TABL... | {
"body": "@Test\n public void testScheduleSplitsBlock()\n {\n StageExecutionPlan plan = createPlan(createFixedSplitSource(80, TestingSplit::createRemoteSplit));\n NodeTaskMap nodeTaskMap = new NodeTaskMap(finalizerService);\n SqlStageExecution stage = createSqlStageExecution(plan, nodeTask... | {
"fields": [
{
"declarator": "stage",
"modifier": "private final",
"original_string": "private final SqlStageExecution stage;",
"type": "SqlStageExecution",
"var_name": "stage"
},
{
"declarator": "splitSource",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public synchronized ScheduleResult schedule()\n {\n dropListenersFromWhenFinishedOrNewLifespansAdded();\n\n int overallSplitAssignmentCount = 0;\n ImmutableSet.Builder<RemoteTask> overallNewTasks = ImmutableSet.builder();\n List<ListenableFuture<?>> overallBloc... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_838 | {
"fields": [
{
"declarator": "DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0}",
"modifier": "private static final",
"original_string": "private static final double[] DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0};",
"type": "double[]",
"var_name": "DOUBLE_VALUES"
},
{
... | {
"body": "@Test\n public void testTan()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"tan(\" + doubleValue + \")\", DOUBLE, Math.tan(doubleValue));\n assertFunction(\"tan(REAL '\" + (float) doubleValue + \"')\", DOUBLE, Math.tan((float) doubleValue));\n ... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Tangent\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double tan(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.tan(num);\n }",
"class_method_signature": "MathFunctions.tan(@SqlType(StandardTypes.DOUBLE) double num)",
"construct... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_615 | {
"fields": [
{
"declarator": "lowMemoryKiller = new TotalReservationOnBlockedNodesLowMemoryKiller()",
"modifier": "private final",
"original_string": "private final LowMemoryKiller lowMemoryKiller = new TotalReservationOnBlockedNodesLowMemoryKiller();",
"type": "LowMemoryKiller",
"v... | {
"body": "@Test\n public void testGeneralPoolHasNoReservation()\n {\n int reservePool = 10;\n int generalPool = 12;\n Map<String, Map<String, Long>> queries = ImmutableMap.<String, Map<String, Long>>builder()\n .put(\"q_1\", ImmutableMap.of(\"n1\", 0L, \"n2\", 0L, \"n3\", 0L... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/memory/TotalReservationOnBlockedNodesLowMemoryKiller.java",
"identifier": "TotalReservationOnBlockedNodesLowMemoryKiller",
"interfaces": "implements LowMemoryKiller",
"methods": [
{
"class_method_signature": "TotalReservationOnBlockedNo... | {
"body": "@Override\n public Optional<QueryId> chooseQueryToKill(List<QueryMemoryInfo> runningQueries, List<MemoryInfo> nodes)\n {\n Map<QueryId, Long> memoryReservationOnBlockedNodes = new HashMap<>();\n for (MemoryInfo node : nodes) {\n MemoryPoolInfo generalPool = node.getPools().ge... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_245 | {
"fields": [
{
"declarator": "METADATA_CODEC = jsonCodec(OrcFileMetadata.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<OrcFileMetadata> METADATA_CODEC = jsonCodec(OrcFileMetadata.class);",
"type": "JsonCodec<OrcFileMetadata>",
"var_n... | {
"body": "@Test\n public void testRewriteAllRowsDeleted()\n throws Exception\n {\n List<Long> columnIds = ImmutableList.of(3L);\n List<Type> columnTypes = ImmutableList.of(BIGINT);\n\n File file = new File(temporary, randomUUID().toString());\n try (OrcFileWriter writer =... | {
"fields": [
{
"declarator": "log = Logger.get(OrcFileRewriter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(OrcFileRewriter.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "CONFIGURATION ... | {
"body": "public static OrcFileInfo rewrite(File input, File output, BitSet rowsToDelete)\n throws IOException\n {\n try (FileSystem fileSystem = new SyncingFileSystem(CONFIGURATION)) {\n Reader reader = createReader(fileSystem, path(input));\n\n if (reader.getNumberOfRows(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_750 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/TestPageUtils.java",
"identifier": "TestPageUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRecordMaterializedBytes()\n {\n Block first = createIntsBlock(1, 2, 3);\n LazyBlock second = lazyWrapper(first);\n LazyBlock third = lazyWrapper(first);\n Page page = new Page(3, first, second, third);\n\n second.getLoadedBlock();\n\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/PageUtils.java",
"identifier": "PageUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PageUtils.PageUtils()",
"constructor": true,
"full_signature": "private PageUtils()",
"identifier": "Pag... | {
"body": "public static void recordMaterializedBytes(Page page, LongConsumer sizeInBytesConsumer)\n {\n // account processed bytes from lazy blocks only when they are loaded\n long loadedBlocksSizeInBytes = 0;\n\n for (int i = 0; i < page.getChannelCount(); ++i) {\n Block block = p... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_300 | {
"fields": [
{
"declarator": "JMX_STATS_DUMP = new Duration(100, TimeUnit.MILLISECONDS)",
"modifier": "private static final",
"original_string": "private static final Duration JMX_STATS_DUMP = new Duration(100, TimeUnit.MILLISECONDS);",
"type": "Duration",
"var_name": "JMX_STATS_DUM... | {
"body": "@Test\n public void testPredicatePushdown()\n throws Exception\n {\n for (Node node : nodes) {\n String nodeIdentifier = node.getNodeIdentifier();\n TupleDomain<ColumnHandle> nodeTupleDomain = TupleDomain.fromFixedValues(ImmutableMap.of(columnHandle, NullableVa... | {
"fields": [
{
"declarator": "nodeManager",
"modifier": "private final",
"original_string": "private final NodeManager nodeManager;",
"type": "NodeManager",
"var_name": "nodeManager"
}
],
"file": "presto-jmx/src/main/java/io/prestosql/plugin/jmx/JmxSplitManager.java",
"ide... | {
"body": "@Override\n public ConnectorSplitSource getSplits(\n ConnectorTransactionHandle transaction,\n ConnectorSession session,\n ConnectorTableHandle table,\n SplitSchedulingStrategy splitSchedulingStrategy,\n DynamicFilter dynamicFilter)\n {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_880 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testRightPad()\n {\n assertFunction(\"RPAD('text', 5, 'x')\", VARCHAR, \"textx\");\n assertFunction(\"RPAD('text', 4, 'x')\", VARCHAR, \"text\");\n\n assertFunction(\"RPAD('text', 6, 'xy')\", VARCHAR, \"textxy\");\n assertFunction(\"RPAD('text', 7, 'xy'... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Pads a string on the right\")\n @ScalarFunction(\"rpad\")\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(StandardTypes.VARCHAR)\n public static Slice rightPad(@SqlType(\"varchar(x)\") Slice text, @SqlType(StandardTypes.BIGINT) long targetLength, @SqlType(\"varchar(y)\") Slice pa... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_183 | {
"fields": [
{
"declarator": "TEST_COLUMN_HANDLE = createBaseColumn(\n \"test\",\n 0,\n HiveType.HIVE_STRING,\n VARCHAR,\n HiveColumnHandle.ColumnType.PARTITION_KEY,\n Optional.empty())",
"modifier": "private static final",
"orig... | {
"body": "@Test\n public void testCreateOnlyNullsPredicate()\n {\n ImmutableList.Builder<HivePartition> partitions = ImmutableList.builder();\n\n for (int i = 0; i < 5; i++) {\n partitions.add(new HivePartition(\n new SchemaTableName(\"test\", \"test\"),\n ... | {
"fields": [
{
"declarator": "PRESTO_VERSION_NAME = \"presto_version\"",
"modifier": "public static final",
"original_string": "public static final String PRESTO_VERSION_NAME = \"presto_version\";",
"type": "String",
"var_name": "PRESTO_VERSION_NAME"
},
{
"declarator":... | {
"body": "@VisibleForTesting\n static TupleDomain<ColumnHandle> createPredicate(List<ColumnHandle> partitionColumns, List<HivePartition> partitions)\n {\n if (partitions.isEmpty()) {\n return TupleDomain.none();\n }\n\n return withColumnDomains(\n partitionColumns... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_479 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestAllOrNoneValueSet.java",
"identifier": "TestAllOrNoneValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testContainsValue()\n {\n assertTrue(AllOrNoneValueSet.all(BIGINT).containsValue(42L));\n assertFalse(AllOrNoneValueSet.none(BIGINT).containsValue(42L));\n }",
"class_method_signature": "TestAllOrNoneValueSet.testContainsValue()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "all",
"modifier": "private final",
"original_string": "private final boolean all;",
... | {
"body": "@Override\n public boolean containsValue(Object value)\n {\n requireNonNull(value, \"value is null\");\n Class<?> expectedClass = Primitives.wrap(type.getJavaType());\n if (!expectedClass.isInstance(value)) {\n throw new IllegalArgumentException(format(\"Value class %s... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_496 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestRange.java",
"identifier": "TestRange",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRange()\n {\n Range range = Range.range(BIGINT, 0L, false, 2L, true);\n assertEquals(range.getLow(), Marker.above(BIGINT, 0L));\n assertEquals(range.getHigh(), Marker.exactly(BIGINT, 2L));\n assertFalse(range.isSingleValue());\n assertFalse(r... | {
"fields": [
{
"declarator": "low",
"modifier": "private final",
"original_string": "private final Marker low;",
"type": "Marker",
"var_name": "low"
},
{
"declarator": "high",
"modifier": "private final",
"original_string": "private final Marker high;",
... | {
"body": "@JsonCreator\n public Range(\n @JsonProperty(\"low\") Marker low,\n @JsonProperty(\"high\") Marker high)\n {\n requireNonNull(low, \"value is null\");\n requireNonNull(high, \"value is null\");\n if (!low.getType().equals(high.getType())) {\n thro... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1276 | {
"fields": [
{
"declarator": "NO_CREATED_BY = Optional.empty()",
"modifier": "private static final",
"original_string": "private static final Optional<String> NO_CREATED_BY = Optional.empty();",
"type": "Optional<String>",
"var_name": "NO_CREATED_BY"
},
{
"declarator":... | {
"body": "@Test(dataProvider = \"allCreatedBy\")\n public void testReadStatsInt32(Optional<String> fileCreatedBy)\n {\n Statistics statistics = new Statistics();\n statistics.setNull_count(13);\n statistics.setMin(fromHex(\"F6FFFFFF\"));\n statistics.setMax(fromHex(\"3AA40000\"));\n... | {
"fields": [
{
"declarator": "MAGIC = Slices.utf8Slice(\"PAR1\")",
"modifier": "private static final",
"original_string": "private static final Slice MAGIC = Slices.utf8Slice(\"PAR1\");",
"type": "Slice",
"var_name": "MAGIC"
},
{
"declarator": "POST_SCRIPT_SIZE = Integ... | {
"body": "public static org.apache.parquet.column.statistics.Statistics<?> readStats(Optional<String> fileCreatedBy, Optional<Statistics> statisticsFromFile, PrimitiveType type)\n {\n Statistics statistics = statisticsFromFile.orElse(null);\n org.apache.parquet.column.statistics.Statistics<?> column... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1149 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testUnknownTransactionCommit()\n {\n TransactionManager transactionManager = createTestTransactionManager();\n\n Session session = sessionBuilder()\n .setTransactionId(TransactionId.create()) // Use a random transaction ID that is unknown to the system... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CommitTask.java",
"identifier": "CommitTask",
"interfaces": "implements DataDefinitionTask<Commit>",
"methods": [
{
"class_method_signature": "CommitTask.getName()",
"constructor": false,
"full_signature": "@Overri... | {
"body": "@Override\n public ListenableFuture<?> execute(Commit statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (session.getTransa... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_253 | {
"fields": [
{
"declarator": "MAX_SHARD_ROWS = 100",
"modifier": "private static final",
"original_string": "private static final long MAX_SHARD_ROWS = 100;",
"type": "long",
"var_name": "MAX_SHARD_ROWS"
},
{
"declarator": "MAX_SHARD_SIZE = DataSize.ofBytes(100)",
... | {
"body": "@Test\n public void testNonTemporalOrganizationSetSimple()\n {\n List<ShardIndexInfo> inputShards = ImmutableList.of(\n shardWithSize(10, 10),\n shardWithSize(10, 10),\n shardWithSize(10, 10));\n\n Set<OrganizationSet> compactionSets = compac... | {
"fields": [
{
"declarator": "maxShardSize",
"modifier": "private final",
"original_string": "private final DataSize maxShardSize;",
"type": "DataSize",
"var_name": "maxShardSize"
},
{
"declarator": "maxShardRows",
"modifier": "private final",
"original_str... | {
"body": "public Set<OrganizationSet> createCompactionSets(Table tableInfo, Collection<ShardIndexInfo> shards)\n {\n Collection<Collection<ShardIndexInfo>> shardsByDaysBuckets = getShardsByDaysBuckets(tableInfo, shards);\n\n ImmutableSet.Builder<OrganizationSet> compactionSets = ImmutableSet.builder... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_603 | {
"fields": [
{
"declarator": "COL1 = new MongoColumnHandle(\"col1\", BIGINT, false)",
"modifier": "private static final",
"original_string": "private static final MongoColumnHandle COL1 = new MongoColumnHandle(\"col1\", BIGINT, false);",
"type": "MongoColumnHandle",
"var_name": "COL... | {
"body": "@Test\n public void testBuildQueryIn()\n {\n TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(\n COL2, Domain.create(ValueSet.ofRanges(equal(createUnboundedVarcharType(), utf8Slice(\"hello\")), equal(createUnboundedVarcharType(), utf8Slice(\"... | {
"fields": [
{
"declarator": "log = Logger.get(MongoSession.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(MongoSession.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "SYSTEM_TABLES = Arra... | {
"body": "@VisibleForTesting\n static Document buildQuery(TupleDomain<ColumnHandle> tupleDomain)\n {\n Document query = new Document();\n if (tupleDomain.getDomains().isPresent()) {\n for (Map.Entry<ColumnHandle, Domain> entry : tupleDomain.getDomains().get().entrySet()) {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_316 | {
"fields": [
{
"declarator": "exampleHttpServer",
"modifier": "private",
"original_string": "private ExampleHttpServer exampleHttpServer;",
"type": "ExampleHttpServer",
"var_name": "exampleHttpServer"
},
{
"declarator": "dataUri",
"modifier": "private",
"or... | {
"body": "@Test\n public void testCursorSimple()\n {\n RecordSet recordSet = new ExampleRecordSet(new ExampleSplit(dataUri), ImmutableList.of(\n new ExampleColumnHandle(\"text\", createUnboundedVarcharType(), 0),\n new ExampleColumnHandle(\"value\", BIGINT, 1)));\n R... | {
"fields": [
{
"declarator": "columnHandles",
"modifier": "private final",
"original_string": "private final List<ExampleColumnHandle> columnHandles;",
"type": "List<ExampleColumnHandle>",
"var_name": "columnHandles"
},
{
"declarator": "columnTypes",
"modifier": ... | {
"body": "@Override\n public RecordCursor cursor()\n {\n return new ExampleRecordCursor(columnHandles, byteSource);\n }",
"class_method_signature": "ExampleRecordSet.cursor()",
"constructor": false,
"full_signature": "@Override public RecordCursor cursor()",
"identifier": "cursor",
"invocat... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_746 | {
"fields": [
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "scheduledExecutor",
"modifier": "private",
"original_string": "priv... | {
"body": "@Test\n public void testExceedMemoryLimit()\n throws Exception\n {\n List<Page> input = rowPagesBuilder(BIGINT)\n .row(1L)\n .build();\n\n DriverContext smallDiverContext = createTaskContext(executor, scheduledExecutor, TEST_SESSION, DataSize.ofB... | {
"fields": [
{
"declarator": "topNProcessor",
"modifier": "private final",
"original_string": "private final TopNProcessor topNProcessor;",
"type": "TopNProcessor",
"var_name": "topNProcessor"
},
{
"declarator": "pages",
"modifier": "private final",
"origin... | {
"body": "@Override\n public void addInput(Page page)\n {\n addPage(page);\n }",
"class_method_signature": "TopNOperator.addInput(Page page)",
"constructor": false,
"full_signature": "@Override public void addInput(Page page)",
"identifier": "addInput",
"invocations": [
"addPage"
],
... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_195 | {
"fields": [
{
"declarator": "forReal",
"modifier": "private",
"original_string": "private boolean forReal;",
"type": "boolean",
"var_name": "forReal"
},
{
"declarator": "successResponse = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><soapenv:Envelope xmlns:soap... | {
"body": "@Test\n public void createAuthenticatedPrincipalFewOrgs()\n {\n String org = \"my18CharOrgId,your18CharOrgId, his18CharOrgId ,her18CharOrgId\"; // As if from salesforce.allowed-organizations property.\n String username = \"user@salesforce.com\";\n String password = \"passtoken\"... | {
"fields": [
{
"declarator": "log = Logger.get(SalesforceBasicAuthenticator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(SalesforceBasicAuthenticator.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@Override\n public Principal createAuthenticatedPrincipal(String username, String password)\n {\n try {\n return userCache.getUnchecked(new Credential(username, password));\n }\n catch (UncheckedExecutionException e) {\n throwIfInstanceOf(e.getCause(), Acces... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_896 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestWordStemFunction.java",
"identifier": "TestWordStemFunction",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testWordStem()\n {\n assertFunction(\"word_stem('')\", createVarcharType(0), \"\");\n assertFunction(\"word_stem('x')\", createVarcharType(1), \"x\");\n assertFunction(\"word_stem('abc')\", createVarcharType(3), \"abc\");\n assertFunction(\"word_stem('g... | {
"fields": [
{
"declarator": "STEMMERS = ImmutableMap.<Slice, Supplier<SnowballProgram>>builder()\n .put(utf8Slice(\"ca\"), CatalanStemmer::new)\n .put(utf8Slice(\"da\"), DanishStemmer::new)\n .put(utf8Slice(\"de\"), German2Stemmer::new)\n .put(utf8Slice(\"en\"),... | {
"body": "@Description(\"Returns the stem of a word in the English language\")\n @ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice wordStem(@SqlType(\"varchar(x)\") Slice slice)\n {\n return wordStem(slice, new EnglishStemmer());\n }",
"class_meth... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1260 | {
"fields": [
{
"declarator": "SHORT_DECIMAL = createDecimalType(5, 2)",
"modifier": "private static final",
"original_string": "private static final Type SHORT_DECIMAL = createDecimalType(5, 2);",
"type": "Type",
"var_name": "SHORT_DECIMAL"
},
{
"declarator": "LONG_DEC... | {
"body": "@Test\n public void testBinary()\n {\n assertEquals(getDomain(VARBINARY, 0, null), none(VARBINARY));\n assertEquals(getDomain(VARBINARY, 10, null), all(VARBINARY));\n\n assertEquals(getDomain(VARBINARY, 0, binaryColumnStats(null)), none(VARBINARY));\n assertEquals(getDomai... | {
"fields": [
{
"declarator": "columnDomains",
"modifier": "private final",
"original_string": "private final List<ColumnDomain> columnDomains;",
"type": "List<ColumnDomain>",
"var_name": "columnDomains"
},
{
"declarator": "orcBloomFiltersEnabled",
"modifier": "pr... | {
"body": "@VisibleForTesting\n public static Domain getDomain(Type type, long rowCount, ColumnStatistics columnStatistics)\n {\n if (rowCount == 0) {\n return Domain.none(type);\n }\n\n if (columnStatistics == null) {\n return Domain.all(type);\n }\n\n i... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_879 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testLeftPad()\n {\n assertFunction(\"LPAD('text', 5, 'x')\", VARCHAR, \"xtext\");\n assertFunction(\"LPAD('text', 4, 'x')\", VARCHAR, \"text\");\n\n assertFunction(\"LPAD('text', 6, 'xy')\", VARCHAR, \"xytext\");\n assertFunction(\"LPAD('text', 7, 'xy')... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Pads a string on the left\")\n @ScalarFunction(\"lpad\")\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(StandardTypes.VARCHAR)\n public static Slice leftPad(@SqlType(\"varchar(x)\") Slice text, @SqlType(StandardTypes.BIGINT) long targetLength, @SqlType(\"varchar(y)\") Slice padS... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_480 | {
"fields": [
{
"declarator": "A = new TestingColumnHandle(\"a\")",
"modifier": "private static final",
"original_string": "private static final ColumnHandle A = new TestingColumnHandle(\"a\");",
"type": "ColumnHandle",
"var_name": "A"
},
{
"declarator": "B = new Testin... | {
"body": "@Test\n public void testNone()\n {\n assertTrue(TupleDomain.none().isNone());\n assertEquals(TupleDomain.<ColumnHandle>none(),\n TupleDomain.withColumnDomains(ImmutableMap.of(\n A, Domain.none(BIGINT))));\n assertEquals(TupleDomain.<ColumnHan... | {
"fields": [
{
"declarator": "NONE = new TupleDomain<>(Optional.empty())",
"modifier": "private static final",
"original_string": "private static final TupleDomain<?> NONE = new TupleDomain<>(Optional.empty());",
"type": "TupleDomain<?>",
"var_name": "NONE"
},
{
"decla... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <T> TupleDomain<T> none()\n {\n return (TupleDomain<T>) NONE;\n }",
"class_method_signature": "TupleDomain.none()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static TupleDomain<T> none()",
"ident... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_654 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java",
"identifier": "TestTinyintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSubtract()\n {\n assertFunction(\"TINYINT'37' - TINYINT'37'\", TINYINT, (byte) 0);\n assertFunction(\"TINYINT'37' - TINYINT'17'\", TINYINT, (byte) (37 - 17));\n assertFunction(\"TINYINT'17' - TINYINT'37'\", TINYINT, (byte) (17 - 37));\n assertFuncti... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java",
"identifier": "TinyintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "TinyintOperators.TinyintOperators()",
"constructor": true,
"full_signature": "private TinyintOperato... | {
"body": "@ScalarOperator(SUBTRACT)\n @SqlType(StandardTypes.TINYINT)\n public static long subtract(@SqlType(StandardTypes.TINYINT) long left, @SqlType(StandardTypes.TINYINT) long right)\n {\n try {\n return SignedBytes.checkedCast(left - right);\n }\n catch (IllegalArgumentE... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_204 | {
"fields": [],
"file": "presto-password-authenticators/src/test/java/io/prestosql/plugin/password/file/TestEncryptionUtil.java",
"identifier": "TestEncryptionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInvalidPasswordFormatPBKDF2()\n {\n // PBKDF2 password with iteration count of 100\n String password = \"100:5b4240333032306164:f38d165fce8ce42f59d366139ef5d9e1ca1247f0e06e503ee1a611dd9ec40876bb5edb8409f5abe5504aab6628e70cfb3d3a18e99d70357d295002c3d0a308a0\";\n ... | {
"fields": [
{
"declarator": "BCRYPT_MIN_COST = 8",
"modifier": "private static final",
"original_string": "private static final int BCRYPT_MIN_COST = 8;",
"type": "int",
"var_name": "BCRYPT_MIN_COST"
},
{
"declarator": "PBKDF2_MIN_ITERATIONS = 1000",
"modifier":... | {
"body": "public static HashingAlgorithm getHashingAlgorithm(String password)\n {\n if (password.startsWith(\"$2y\")) {\n if (getBCryptCost(password) < BCRYPT_MIN_COST) {\n throw new HashedPasswordException(\"Minimum cost of BCrypt password must be \" + BCRYPT_MIN_COST);\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_711 | {
"fields": [
{
"declarator": "nodeInfo = new NodeInfo(\"test\")",
"modifier": "private final",
"original_string": "private final NodeInfo nodeInfo = new NodeInfo(\"test\");",
"type": "NodeInfo",
"var_name": "nodeInfo"
},
{
"declarator": "internalCommunicationConfig = n... | {
"body": "@Test\n public void testGetCoordinators()\n {\n DiscoveryNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new NoOpFailureDetector(), expectedVersion, testHttpClient, internalCommunicationConfig);\n try {\n assertEquals(manager.getCoordinators(), ImmutableSet... | {
"fields": [
{
"declarator": "log = Logger.get(DiscoveryNodeManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(DiscoveryNodeManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "CONN... | {
"body": "@Override\n public synchronized Set<InternalNode> getCoordinators()\n {\n return coordinators;\n }",
"class_method_signature": "DiscoveryNodeManager.getCoordinators()",
"constructor": false,
"full_signature": "@Override public synchronized Set<InternalNode> getCoordinators()",
"iden... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_341 | {
"fields": [
{
"declarator": "TEST_CATALOG = \"test_catalog\"",
"modifier": "private static final",
"original_string": "private static final String TEST_CATALOG = \"test_catalog\";",
"type": "String",
"var_name": "TEST_CATALOG"
},
{
"declarator": "COUNTING_CATALOG = \"... | {
"body": "@Test\n public void testGetSchemas()\n throws Exception\n {\n List<List<String>> hive = new ArrayList<>();\n hive.add(list(\"hive\", \"information_schema\"));\n hive.add(list(\"hive\", \"default\"));\n\n List<List<String>> countingCatalog = new ArrayList<>();\n ... | {
"fields": [
{
"declarator": "SEARCH_STRING_ESCAPE = \"\\\\\"",
"modifier": "private static final",
"original_string": "private static final String SEARCH_STRING_ESCAPE = \"\\\\\";",
"type": "String",
"var_name": "SEARCH_STRING_ESCAPE"
},
{
"declarator": "connection",
... | {
"body": "@Override\n public ResultSet getSchemas()\n throws SQLException\n {\n return select(\"\" +\n \"SELECT TABLE_SCHEM, TABLE_CATALOG\\n\" +\n \"FROM system.jdbc.schemas\\n\" +\n \"ORDER BY TABLE_CATALOG, TABLE_SCHEM\");\n }",
"class_meth... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_592 | {
"fields": [
{
"declarator": "tempDirectory",
"modifier": "private",
"original_string": "private Path tempDirectory;",
"type": "Path",
"var_name": "tempDirectory"
}
],
"file": "presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHiveHadoop2Plugin.java",
"identif... | {
"body": "@Test\n public void testGcsAccessTokenAndHiveCachingMutuallyExclusive()\n {\n Plugin plugin = new HiveHadoop2Plugin();\n ConnectorFactory connectorFactory = Iterables.getOnlyElement(plugin.getConnectorFactories());\n\n assertThatThrownBy(() -> connectorFactory.create(\n ... | {
"fields": [],
"file": "presto-hive-hadoop2/src/main/java/io/prestosql/plugin/hive/HiveHadoop2Plugin.java",
"identifier": "HiveHadoop2Plugin",
"interfaces": "implements Plugin",
"methods": [
{
"class_method_signature": "HiveHadoop2Plugin.getConnectorFactories()",
"constructor": false,
"... | {
"body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new HiveConnectorFactory(\"hive-hadoop2\"));\n }",
"class_method_signature": "HiveHadoop2Plugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Override public Itera... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_438 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestSqlTimestamp.java",
"identifier": "TestSqlTimestamp",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToLocalDateTime()\n {\n SqlTimestamp timestamp = newInstance(9, 1367846055987654L, 321_000);\n assertThat(timestamp.toString()).isEqualTo(\"2013-05-06 13:14:15.987654321\");\n assertThat(timestamp.toLocalDateTime()).isEqualTo(LocalDateTime.of(2013, 5, 6, 1... | {
"fields": [
{
"declarator": "precision",
"modifier": "private final",
"original_string": "private final int precision;",
"type": "int",
"var_name": "precision"
},
{
"declarator": "epochMicros",
"modifier": "private final",
"original_string": "private final... | {
"body": "public LocalDateTime toLocalDateTime()\n {\n long epochSecond = floorDiv(epochMicros, MICROSECONDS_PER_SECOND);\n int microOfSecond = floorMod(epochMicros, MICROSECONDS_PER_SECOND);\n int nanoOfSecond = (microOfSecond * NANOSECONDS_PER_MICROSECOND) +\n toIntExact(roun... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1237 | {
"fields": [],
"file": "presto-pinot/src/test/java/io/prestosql/pinot/query/TestDynamicTable.java",
"identifier": "TestDynamicTable",
"interfaces": "",
"superclass": "extends TestPinotQueryBase"
} | {
"body": "@Test\n public void testSelectStarDynamicTable()\n {\n String tableName = realtimeOnlyTable.getTableName();\n String query = format(\"select * from %s limit 70\", tableName.toLowerCase(ENGLISH));\n DynamicTable dynamicTable = buildFromPql(pinotMetadata, new SchemaTableName(\"defa... | {
"fields": [
{
"declarator": "tableName",
"modifier": "private final",
"original_string": "private final String tableName;",
"type": "String",
"var_name": "tableName"
},
{
"declarator": "suffix",
"modifier": "private final",
"original_string": "private fina... | {
"body": "@JsonProperty\n public String getTableName()\n {\n return tableName;\n }",
"class_method_signature": "DynamicTable.getTableName()",
"constructor": false,
"full_signature": "@JsonProperty public String getTableName()",
"identifier": "getTableName",
"invocations": [],
"modifiers":... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_984 | {
"fields": [
{
"declarator": "A = new Symbol(\"a\")",
"modifier": "private static final",
"original_string": "private static final Symbol A = new Symbol(\"a\");",
"type": "Symbol",
"var_name": "A"
},
{
"declarator": "B = new Symbol(\"b\")",
"modifier": "private s... | {
"body": "@Test\n public void testProjectWithSymbolReuse()\n {\n // symbol B is reused so underlying predicates involving BE are invalid after Projection\n // and will not be included in the resulting predicate\n PlanNode projectReusingB = new ProjectNode(\n newId(),\n ... | {
"fields": [
{
"declarator": "SYMBOL_MATCHES_EXPRESSION =\n entry -> entry.getValue().equals(entry.getKey().toSymbolReference())",
"modifier": "private static final",
"original_string": "private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION... | {
"body": "public Expression extract(Session session, PlanNode node, TypeProvider types, TypeAnalyzer typeAnalyzer)\n {\n return node.accept(new Visitor(domainTranslator, metadata, session, types, typeAnalyzer, useTableProperties), null);\n }",
"class_method_signature": "EffectivePredicateExtractor.ext... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1240 | {
"fields": [],
"file": "presto-orc/src/test/java/io/prestosql/orc/TestOrcDataSourceUtils.java",
"identifier": "TestOrcDataSourceUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeSingle()\n {\n List<DiskRange> diskRanges = mergeAdjacentDiskRanges(\n ImmutableList.of(new DiskRange(100, 100)),\n DataSize.ofBytes(0),\n DataSize.ofBytes(0));\n assertEquals(diskRanges, ImmutableList.of(new Disk... | {
"fields": [],
"file": "presto-orc/src/main/java/io/prestosql/orc/OrcDataSourceUtils.java",
"identifier": "OrcDataSourceUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrcDataSourceUtils.OrcDataSourceUtils()",
"constructor": true,
"full_signature": "private OrcDataS... | {
"body": "public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize)\n {\n // sort ranges by start offset\n List<DiskRange> ranges = new ArrayList<>(diskRanges);\n ranges.sort(comparingLong(DiskRange::getOffset));\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_859 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCharLength()\n {\n assertFunction(\"LENGTH(CAST('hello' AS CHAR(5)))\", BIGINT, 5L);\n assertFunction(\"LENGTH(CAST('Quadratically' AS CHAR(13)))\", BIGINT, 13L);\n assertFunction(\"LENGTH(CAST('' AS CHAR(20)))\", BIGINT, 20L);\n assertFunction(\"LE... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Count of code points of the given string\")\n @ScalarFunction(\"length\")\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.BIGINT)\n public static long charLength(@LiteralParameter(\"x\") long x, @SqlType(\"char(x)\") Slice slice)\n {\n return x;\n }",
"class_m... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_7 | {
"fields": [],
"file": "presto-client/src/test/java/io/prestosql/client/TestIntervalDayTime.java",
"identifier": "TestIntervalDayTime",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void textMaxDays()\n {\n long days = Long.MAX_VALUE / DAYS.toMillis(1);\n assertEquals(toMillis(days, 0, 0, 0, 0), DAYS.toMillis(days));\n }",
"class_method_signature": "TestIntervalDayTime.textMaxDays()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "MILLIS_IN_SECOND = 1000",
"modifier": "private static final",
"original_string": "private static final long MILLIS_IN_SECOND = 1000;",
"type": "long",
"var_name": "MILLIS_IN_SECOND"
},
{
"declarator": "MILLIS_IN_MINUTE = 60 * MILLIS_IN_SEC... | {
"body": "public static long toMillis(long day, long hour, long minute, long second, long millis)\n {\n try {\n long value = millis;\n value = addExact(value, multiplyExact(day, MILLIS_IN_DAY));\n value = addExact(value, multiplyExact(hour, MILLIS_IN_HOUR));\n va... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_336 | {
"fields": [
{
"declarator": "TEST_CATALOG = \"test_catalog\"",
"modifier": "private static final",
"original_string": "private static final String TEST_CATALOG = \"test_catalog\";",
"type": "String",
"var_name": "TEST_CATALOG"
},
{
"declarator": "COUNTING_CATALOG = \"... | {
"body": "@Test\n public void testGetClientInfoProperties()\n throws Exception\n {\n DatabaseMetaData metaData = connection.getMetaData();\n\n try (ResultSet resultSet = metaData.getClientInfoProperties()) {\n assertResultSet(resultSet)\n .hasColumnCount(4... | {
"fields": [
{
"declarator": "SEARCH_STRING_ESCAPE = \"\\\\\"",
"modifier": "private static final",
"original_string": "private static final String SEARCH_STRING_ESCAPE = \"\\\\\";",
"type": "String",
"var_name": "SEARCH_STRING_ESCAPE"
},
{
"declarator": "connection",
... | {
"body": "@Override\n public ResultSet getClientInfoProperties()\n throws SQLException\n {\n ClientTypeSignature varchar = new ClientTypeSignature(\"varchar\", ImmutableList.of(ClientTypeSignatureParameter.ofLong(VARCHAR_UNBOUNDED_LENGTH)));\n\n ImmutableList.Builder<Column> columns = ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_766 | {
"fields": [
{
"declarator": "executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass()... | {
"body": "@Test\n public void testProjectEmptyPage()\n {\n PageProcessor pageProcessor = new PageProcessor(Optional.of(new SelectAllFilter()), ImmutableList.of(new InputPageProjection(0, BIGINT)));\n\n Page inputPage = new Page(createLongSequenceBlock(0, 0));\n\n LocalMemoryContext memoryC... | {
"fields": [
{
"declarator": "MAX_BATCH_SIZE = 8 * 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_BATCH_SIZE = 8 * 1024;",
"type": "int",
"var_name": "MAX_BATCH_SIZE"
},
{
"declarator": "MAX_PAGE_SIZE_IN_BYTES = 4 * 1024 * 102... | {
"body": "public Iterator<Optional<Page>> process(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page)\n {\n return process(session, yieldSignal, memoryContext, page, false);\n }",
"class_method_signature": "PageProcessor.process(ConnectorSession sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1186 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testAddAfterNoMorePages()\n {\n ClientBuffer buffer = new ClientBuffer(TASK_INSTANCE_ID, BUFFER_ID);\n buffer.setNoMorePages();\n addPage(buffer, createPage(0));\n addPage(buffer, createPage(0));\n assertBufferInfo(buffer, 0, 0);\n }",
"clas... | {
"fields": [
{
"declarator": "taskInstanceId",
"modifier": "private final",
"original_string": "private final String taskInstanceId;",
"type": "String",
"var_name": "taskInstanceId"
},
{
"declarator": "bufferId",
"modifier": "private final",
"original_strin... | {
"body": "public void setNoMorePages()\n {\n PendingRead pendingRead;\n synchronized (this) {\n // ignore duplicate calls\n if (noMorePages) {\n return;\n }\n\n noMorePages = true;\n\n pendingRead = this.pendingRead;\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1169 | {
"fields": [
{
"declarator": "CATALOG_NAME = \"catalog\"",
"modifier": "private static final",
"original_string": "private static final String CATALOG_NAME = \"catalog\";",
"type": "String",
"var_name": "CATALOG_NAME"
},
{
"declarator": "PARENT_TABLE = new ConnectorTab... | {
"body": "@Test\n public void testCreateLikeWithPropertiesDenyPermission()\n {\n CreateTable statement = getCreatleLikeStatement(true);\n\n TestingAccessControlManager accessControl = new TestingAccessControlManager(transactionManager, new EventListenerManager(new EventListenerConfig()));\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CreateTableTask.java",
"identifier": "CreateTableTask",
"interfaces": "implements DataDefinitionTask<CreateTable>",
"methods": [
{
"class_method_signature": "CreateTableTask.getName()",
"constructor": false,
"full_... | {
"body": "@VisibleForTesting\n ListenableFuture<?> internalExecute(CreateTable statement, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters)\n {\n checkArgument(!statement.getElements().isEmpty(), \"no columns for table\");\n\n Map<NodeRef<Parameter>, Ex... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_789 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testToBase64Url()\n {\n assertFunction(\"to_base64url(CAST('' AS VARBINARY))\", VARCHAR, encodeBase64Url(\"\"));\n assertFunction(\"to_base64url(CAST('a' AS VARBINARY))\", VARCHAR, encodeBase64Url(\"a\"));\n assertFunction(\"to_base64url(CAST('abc' AS VARBINAR... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Encode binary data as base64 using the URL safe alphabet\")\n @ScalarFunction(\"to_base64url\")\n @SqlType(StandardTypes.VARCHAR)\n public static Slice toBase64Url(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n if (slice.hasByteArray()) {\n return Slices.w... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_273 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/TestRaptorPlugin.java",
"identifier": "TestRaptorPlugin",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlugin()\n throws Exception\n {\n Plugin plugin = new RaptorPlugin();\n ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());\n assertInstanceOf(factory, RaptorConnectorFactory.class);\n\n File tmpDir = Files.createTe... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "metadataModule",
"modifier": "private final",
"original_string": "private final Modul... | {
"body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new RaptorConnectorFactory(name, metadataModule, backupProviders));\n }",
"class_method_signature": "RaptorPlugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Ove... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_623 | {
"fields": [
{
"declarator": "TYPE_OPERATORS_CACHE = new TypeOperators()",
"modifier": "private static final",
"original_string": "private static final TypeOperators TYPE_OPERATORS_CACHE = new TypeOperators();",
"type": "TypeOperators",
"var_name": "TYPE_OPERATORS_CACHE"
}
],
... | {
"body": "@Test\n public void testEmptyStreams()\n {\n List<Type> types = ImmutableList.of(INTEGER, BIGINT, DOUBLE);\n MaterializedResult actual = mergeSortedPages(\n types,\n ImmutableList.of(0, 1),\n ImmutableList.of(ASC_NULLS_FIRST, ASC_NULLS_FIRST)... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/util/MergeSortedPages.java",
"identifier": "MergeSortedPages",
"interfaces": "",
"methods": [
{
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPag... | {
"body": "private MergeSortedPages() {}",
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPages()",
"identifier": "MergeSortedPages",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1217 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/execution/scheduler/TestPhasedExecutionSchedule.java",
"identifier": "TestPhasedExecutionSchedule",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testJoinWithDeepSources()\n {\n PlanFragment buildSourceFragment = createTableScanPlanFragment(\"buildSource\");\n PlanFragment buildMiddleFragment = createExchangePlanFragment(\"buildMiddle\", buildSourceFragment);\n PlanFragment buildTopFragment = createExch... | {
"fields": [
{
"declarator": "schedulePhases",
"modifier": "private final",
"original_string": "private final List<Set<SqlStageExecution>> schedulePhases;",
"type": "List<Set<SqlStageExecution>>",
"var_name": "schedulePhases"
},
{
"declarator": "activeSources = new Has... | {
"body": "@VisibleForTesting\n static List<Set<PlanFragmentId>> extractPhases(Collection<PlanFragment> fragments)\n {\n // Build a graph where the plan fragments are vertexes and the edges represent\n // a before -> after relationship. For example, a join hash build has an edge\n // to th... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_94 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/alluxio/TestProtoUtils.java",
"identifier": "TestProtoUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPartition()\n {\n alluxio.grpc.table.layout.hive.PartitionInfo.Builder partitionInfo = TestingAlluxioMetastoreObjects.getTestingPartitionInfo();\n Partition partition = ProtoUtils.fromProto(partitionInfo.build());\n assertEquals(\n partition... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/alluxio/ProtoUtils.java",
"identifier": "ProtoUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProtoUtils.ProtoUtils()",
"constructor": true,
"full_signature": "private ProtoUtils()"... | {
"body": "public static Database fromProto(alluxio.grpc.table.Database db)\n {\n return Database.builder()\n .setDatabaseName(db.getDbName())\n .setLocation(db.hasLocation() ? Optional.of(db.getLocation()) : Optional.empty())\n .setOwnerName(db.getOwnerName())\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_418 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTGeometryN()\n {\n assertSTGeometryN(\"POINT EMPTY\", 1, null);\n assertSTGeometryN(\"LINESTRING EMPTY\", 1, null);\n assertSTGeometryN(\"POLYGON EMPTY\", 1, null);\n assertSTGeometryN(\"MULTIPOINT EMPTY\", 1, null);\n assertSTGeometryN(\"MU... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@SqlNullable\n @Description(\"Returns the geometry element at the specified index (indices started with 1)\")\n @ScalarFunction(\"ST_GeometryN\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stGeometryN(@SqlType(GEOMETRY_TYPE_NAME) Slice input, @SqlType(INTEGER) long index)\n {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_731 | {
"fields": [
{
"declarator": "TWO = new BigInteger(\"2\")",
"modifier": "private static final",
"original_string": "private static final BigInteger TWO = new BigInteger(\"2\");",
"type": "BigInteger",
"var_name": "TWO"
},
{
"declarator": "TYPE = createDecimalType(38, 0... | {
"body": "@Test\n public void testOverflow()\n {\n addToState(state, TWO.pow(126));\n\n assertEquals(state.getLong(), 1);\n assertEquals(state.getOverflow(), 0);\n assertEquals(state.getLongDecimal(), unscaledDecimal(TWO.pow(126)));\n\n addToState(state, TWO.pow(126));\n\n ... | {
"fields": [
{
"declarator": "DECIMAL_AVERAGE_AGGREGATION = new DecimalAverageAggregation()",
"modifier": "public static final",
"original_string": "public static final DecimalAverageAggregation DECIMAL_AVERAGE_AGGREGATION = new DecimalAverageAggregation();",
"type": "DecimalAverageAggreg... | {
"body": "@VisibleForTesting\n public static BigDecimal average(LongDecimalWithOverflowAndLongState state, DecimalType type)\n {\n BigDecimal sum = new BigDecimal(Decimals.decodeUnscaledValue(state.getLongDecimal()), type.getScale());\n BigDecimal count = BigDecimal.valueOf(state.getLong());\n\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_361 | {
"fields": [],
"file": "presto-parser/src/test/java/io/prestosql/sql/parser/TestStatementSplitter.java",
"identifier": "TestStatementSplitter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSqueezeStatementWithBackquote()\n {\n String sql = \"select ` f``o o`` ` from dual\";\n assertEquals(squeezeStatement(sql), \"select ` f``o o`` ` from dual\");\n }",
"class_method_signature": "TestStatementSplitter.testSqueezeStatementWithBackquote()"... | {
"fields": [
{
"declarator": "completeStatements",
"modifier": "private final",
"original_string": "private final List<Statement> completeStatements;",
"type": "List<Statement>",
"var_name": "completeStatements"
},
{
"declarator": "partialStatement",
"modifier": ... | {
"body": "public static String squeezeStatement(String sql)\n {\n TokenSource tokens = getLexer(sql, ImmutableSet.of());\n StringBuilder sb = new StringBuilder();\n while (true) {\n Token token = tokens.nextToken();\n if (token.getType() == Token.EOF) {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_674 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestSmallintOperators.java",
"identifier": "TestSmallintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToBoolean()\n {\n assertFunction(\"cast(SMALLINT'37' as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(SMALLINT'17' as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(SMALLINT'0' as boolean)\", BOOLEAN, false);\n }",
"class_method_signatu... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/SmallintOperators.java",
"identifier": "SmallintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "SmallintOperators.SmallintOperators()",
"constructor": true,
"full_signature": "private SmallintOp... | {
"body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean castToBoolean(@SqlType(StandardTypes.SMALLINT) long value)\n {\n return value != 0;\n }",
"class_method_signature": "SmallintOperators.castToBoolean(@SqlType(StandardTypes.SMALLINT) long value)",
"constru... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_224 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/metadata/TestJdbcDatabaseConfig.java",
"identifier": "TestJdbcDatabaseConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(JdbcDatabaseConfig.class)\n .setUrl(null));\n }",
"class_method_signature": "TestJdbcDatabaseConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public void testDefaults()"... | {
"fields": [
{
"declarator": "url",
"modifier": "private",
"original_string": "private String url;",
"type": "String",
"var_name": "url"
}
],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java",
"identifier": "Jdb... | {
"body": "@Config(\"metadata.db.url\")\n public JdbcDatabaseConfig setUrl(String url)\n {\n this.url = url;\n return this;\n }",
"class_method_signature": "JdbcDatabaseConfig.setUrl(String url)",
"constructor": false,
"full_signature": "@Config(\"metadata.db.url\") public JdbcDatabaseCon... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1094 | {
"fields": [
{
"declarator": "LONG_LASTING_QUERY = \"SELECT * FROM tpch.sf1.lineitem\"",
"modifier": "private static final",
"original_string": "private static final String LONG_LASTING_QUERY = \"SELECT * FROM tpch.sf1.lineitem\";",
"type": "String",
"var_name": "LONG_LASTING_QUERY"... | {
"body": "@Test\n public void testGetQueryStateInfo()\n {\n QueryStateInfo info = client.execute(\n prepareGet()\n .setUri(server.resolve(\"/v1/queryState/\" + queryResults.getId()))\n .setHeader(PRESTO_USER, \"unknown\")\n ... | {
"fields": [
{
"declarator": "dispatchManager",
"modifier": "private final",
"original_string": "private final DispatchManager dispatchManager;",
"type": "DispatchManager",
"var_name": "dispatchManager"
},
{
"declarator": "resourceGroupManager",
"modifier": "priv... | {
"body": "private QueryStateInfo getQueryStateInfo(BasicQueryInfo queryInfo)\n {\n Optional<ResourceGroupId> groupId = queryInfo.getResourceGroupId();\n if (queryInfo.getState() == QUEUED) {\n return createQueuedQueryStateInfo(\n queryInfo,\n groupId,... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1201 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testAcknowledge()\n {\n OutputBuffers outputBuffers = createInitialEmptyOutputBuffers(ARBITRARY);\n ArbitraryOutputBuffer buffer = createArbitraryBuffer(outputBuffers, sizeOfPages(10));\n\n // add three items\n for (int i = 0; i < 3; i++) {\n ... | {
"fields": [
{
"declarator": "memoryManager",
"modifier": "private final",
"original_string": "private final OutputBufferMemoryManager memoryManager;",
"type": "OutputBufferMemoryManager",
"var_name": "memoryManager"
},
{
"declarator": "outputBuffers = createInitialEmp... | {
"body": "@Override\n public void acknowledge(OutputBufferId bufferId, long sequenceId)\n {\n checkState(!Thread.holdsLock(this), \"Cannot acknowledge pages while holding a lock on this\");\n requireNonNull(bufferId, \"bufferId is null\");\n\n getBuffer(bufferId).acknowledgePages(sequenceI... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_818 | {
"fields": [
{
"declarator": "DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0}",
"modifier": "private static final",
"original_string": "private static final double[] DOUBLE_VALUES = {123, -123, 123.45, -123.45, 0};",
"type": "double[]",
"var_name": "DOUBLE_VALUES"
},
{
... | {
"body": "@Test\n public void testExp()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"exp(\" + doubleValue + \")\", DOUBLE, Math.exp(doubleValue));\n assertFunction(\"exp(REAL '\" + (float) doubleValue + \"')\", DOUBLE, Math.exp((float) doubleValue));\n ... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Euler's number raised to the given power\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double exp(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.exp(num);\n }",
"class_method_signature": "MathFunctions.exp(@SqlType(StandardTypes.D... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_82 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java",
"identifier": "TestAlluxioHiveMetastoreConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMapping()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"hive.metastore.alluxio.master.address\", \"localhost:19998\")\n .build();\n\n AlluxioHiveMetastoreConfig expected = ... | {
"fields": [
{
"declarator": "masterAddress",
"modifier": "private",
"original_string": "private String masterAddress;",
"type": "String",
"var_name": "masterAddress"
}
],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/alluxio/AlluxioHiveMetastoreConfi... | {
"body": "@Config(\"hive.metastore.alluxio.master.address\")\n @ConfigDescription(\"Alluxio master address\")\n public AlluxioHiveMetastoreConfig setMasterAddress(String masterAddress)\n {\n this.masterAddress = masterAddress;\n return this;\n }",
"class_method_signature": "AlluxioHiveMet... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_377 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testGeometryGetObjectValue()\n {\n BlockBuilder builder = GEOMETRY.createBlockBuilder(null, 1);\n GEOMETRY.writeSlice(builder, GeoFunctions.stPoint(1.2, 3.4));\n Block block = builder.build();\n\n assertEquals(\"POINT (1.2 3.4)\", GEOMETRY.getObjectValu... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns a Geometry type Point object with the given coordinate values\")\n @ScalarFunction(\"ST_Point\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stPoint(@SqlType(DOUBLE) double x, @SqlType(DOUBLE) double y)\n {\n OGCGeometry geometry = createFromEsriGeometry(n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_727 | {
"fields": [
{
"declarator": "blockTypeOperators = new BlockTypeOperators(new TypeOperators())",
"modifier": "private",
"original_string": "private BlockTypeOperators blockTypeOperators = new BlockTypeOperators(new TypeOperators());",
"type": "BlockTypeOperators",
"var_name": "block... | {
"body": "@Test\n public void testBinaryMergeIteratorOverPageWith()\n {\n Page emptyPage = new Page(0, BIGINT.createFixedSizeBlockBuilder(0).build());\n Page page = rowPagesBuilder(BIGINT).row(42).build().get(0);\n\n WorkProcessor<Page> mergedPage = new MergeHashSort(newSimpleAggregatedMem... | {
"fields": [
{
"declarator": "memoryContext",
"modifier": "private final",
"original_string": "private final AggregatedMemoryContext memoryContext;",
"type": "AggregatedMemoryContext",
"var_name": "memoryContext"
},
{
"declarator": "blockTypeOperators",
"modifier... | {
"body": "public WorkProcessor<Page> merge(List<Type> keyTypes, List<Type> allTypes, List<WorkProcessor<Page>> channels, DriverYieldSignal driverYieldSignal)\n {\n InterpretedHashGenerator hashGenerator = createHashGenerator(keyTypes);\n return mergeSortedPages(\n channels,\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1128 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/TestJmxNamingConfig.java",
"identifier": "TestJmxNamingConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"jmx.base-name\", \"my.stuff\")\n .build();\n\n JmxNamingConfig expected = new JmxNamingConfig()\n .s... | {
"fields": [
{
"declarator": "domainBase = \"presto\"",
"modifier": "private",
"original_string": "private String domainBase = \"presto\";",
"type": "String",
"var_name": "domainBase"
}
],
"file": "presto-main/src/main/java/io/prestosql/server/JmxNamingConfig.java",
"ident... | {
"body": "@Config(\"jmx.base-name\")\n public JmxNamingConfig setDomainBase(String domainBase)\n {\n this.domainBase = domainBase;\n return this;\n }",
"class_method_signature": "JmxNamingConfig.setDomainBase(String domainBase)",
"constructor": false,
"full_signature": "@Config(\"jmx.bas... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1082 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/cost/TestStatisticRange.java",
"identifier": "TestStatisticRange",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOverlapPercentWith()\n {\n StatisticRange zeroToTen = range(0, 10, 10);\n StatisticRange empty = StatisticRange.empty();\n\n // Equal ranges\n assertOverlap(zeroToTen, range(0, 10, 5), 1);\n assertOverlap(zeroToTen, range(0, 10, 20), 1);\n ... | {
"fields": [
{
"declarator": "INFINITE_TO_FINITE_RANGE_INTERSECT_OVERLAP_HEURISTIC_FACTOR = 0.25",
"modifier": "private static final",
"original_string": "private static final double INFINITE_TO_FINITE_RANGE_INTERSECT_OVERLAP_HEURISTIC_FACTOR = 0.25;",
"type": "double",
"var_name": ... | {
"body": "public double overlapPercentWith(StatisticRange other)\n {\n requireNonNull(other, \"other is null\");\n\n if (this.isEmpty() || other.isEmpty() || this.distinctValues == 0 || other.distinctValues == 0) {\n return 0.0; // zero is better than NaN as it will behave properly for ca... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_232 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testCleanLocalShards()\n throws Exception\n {\n assertEquals(cleaner.getLocalShardsCleaned().getTotalCount(), 0);\n\n TestingShardDao shardDao = dbi.onDemand(TestingShardDao.class);\n MetadataDao metadataDao = dbi.onDemand(MetadataDao.class);\n\n ... | {
"fields": [
{
"declarator": "log = Logger.get(ShardCleaner.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(ShardCleaner.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dao",
"modifie... | {
"body": "@VisibleForTesting\n synchronized void cleanLocalShards()\n {\n // find all files on the local node\n Set<UUID> local = getLocalShards();\n\n // get shards assigned to the local node\n Set<UUID> assigned = dao.getNodeShards(currentNode, null).stream()\n .map... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_398 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTEnvelope()\n {\n assertFunction(\"ST_AsText(ST_Envelope(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)')))\", VARCHAR, \"POLYGON ((1 2, 4 2, 4 8, 1 8, 1 2))\");\n assertFunction(\"ST_AsText(ST_Envelope(ST_GeometryFromText('LINESTRING EMPTY')))\", VARCHAR,... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns the bounding rectangular polygon of a Geometry\")\n @ScalarFunction(\"ST_Envelope\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stEnvelope(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n Envelope envelope = deserializeEnvelope(input);\n if (envelop... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_662 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java",
"identifier": "TestTinyintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToDouble()\n {\n assertFunction(\"cast(TINYINT'37' as double)\", DOUBLE, 37.0);\n assertFunction(\"cast(TINYINT'17' as double)\", DOUBLE, 17.0);\n }",
"class_method_signature": "TestTinyintOperators.testCastToDouble()",
"constructor": false,
"full_si... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java",
"identifier": "TinyintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "TinyintOperators.TinyintOperators()",
"constructor": true,
"full_signature": "private TinyintOperato... | {
"body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.DOUBLE)\n public static double castToDouble(@SqlType(StandardTypes.TINYINT) long value)\n {\n return value;\n }",
"class_method_signature": "TinyintOperators.castToDouble(@SqlType(StandardTypes.TINYINT) long value)",
"constructor": false... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1256 | {
"fields": [
{
"declarator": "SHORT_DECIMAL = createDecimalType(5, 2)",
"modifier": "private static final",
"original_string": "private static final Type SHORT_DECIMAL = createDecimalType(5, 2);",
"type": "Type",
"var_name": "SHORT_DECIMAL"
},
{
"declarator": "LONG_DEC... | {
"body": "@Test\n public void testInstantMillis()\n {\n assertThat(getDomain(TIMESTAMP_TZ_MILLIS, 0, null))\n .isEqualTo(none(TIMESTAMP_TZ_MILLIS));\n assertThat(getDomain(TIMESTAMP_TZ_MILLIS, 10, null))\n .isEqualTo(all(TIMESTAMP_TZ_MILLIS));\n\n assertThat(g... | {
"fields": [
{
"declarator": "columnDomains",
"modifier": "private final",
"original_string": "private final List<ColumnDomain> columnDomains;",
"type": "List<ColumnDomain>",
"var_name": "columnDomains"
},
{
"declarator": "orcBloomFiltersEnabled",
"modifier": "pr... | {
"body": "@VisibleForTesting\n public static Domain getDomain(Type type, long rowCount, ColumnStatistics columnStatistics)\n {\n if (rowCount == 0) {\n return Domain.none(type);\n }\n\n if (columnStatistics == null) {\n return Domain.all(type);\n }\n\n i... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.