id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
166515022_325 | {
"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 testGetRecordSet()\n {\n ConnectorTableHandle tableHandle = new ExampleTableHandle(\"schema\", \"table\");\n ExampleRecordSetProvider recordSetProvider = new ExampleRecordSetProvider();\n RecordSet recordSet = recordSetProvider.getRecordSet(ExampleTransactionH... | {
"fields": [],
"file": "presto-example-http/src/main/java/io/prestosql/plugin/example/ExampleRecordSetProvider.java",
"identifier": "ExampleRecordSetProvider",
"interfaces": "implements ConnectorRecordSetProvider",
"methods": [
{
"class_method_signature": "ExampleRecordSetProvider.getRecordSet(Conn... | {
"body": "@Override\n public RecordSet getRecordSet(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorSplit split, ConnectorTableHandle table, List<? extends ColumnHandle> columns)\n {\n ExampleSplit exampleSplit = (ExampleSplit) split;\n\n ImmutableList.Builder<ExampleCo... | {
"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_132 | {
"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 testValidatePartitionStatistics()\n {\n assertInvalidStatistics(\n PartitionStatistics.builder()\n .setBasicStatistics(new HiveBasicStatistics(-1, 0, 0, 0))\n .build(),\n invalidPartitionStatistics(... | {
"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 void validatePartitionStatistics(SchemaTableName table, Map<String, PartitionStatistics> partitionStatistics)\n {\n partitionStatistics.forEach((partition, statistics) -> {\n HiveBasicStatistics basicStatistics = statistics.getBasicStatistics();\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_562 | {
"fields": [
{
"declarator": "tokenRing = Murmur3PartitionerTokenRing.INSTANCE",
"modifier": "private static final",
"original_string": "private static final Murmur3PartitionerTokenRing tokenRing = Murmur3PartitionerTokenRing.INSTANCE;",
"type": "Murmur3PartitionerTokenRing",
"var_n... | {
"body": "@Test\n public void testGetTokenCountInRange()\n {\n assertEquals(tokenRing.getTokenCountInRange(\"0\", \"1\"), ONE);\n assertEquals(tokenRing.getTokenCountInRange(\"-1\", \"1\"), new BigInteger(\"2\"));\n assertEquals(tokenRing.getTokenCountInRange(\"-100\", \"100\"), new BigInt... | {
"fields": [
{
"declarator": "INSTANCE = new Murmur3PartitionerTokenRing()",
"modifier": "public static final",
"original_string": "public static final Murmur3PartitionerTokenRing INSTANCE = new Murmur3PartitionerTokenRing();",
"type": "Murmur3PartitionerTokenRing",
"var_name": "INS... | {
"body": "@Override\n public BigInteger getTokenCountInRange(String startToken, String endToken)\n {\n long start = Long.parseLong(startToken);\n long end = Long.parseLong(endToken);\n\n if (start == end) {\n if (start == MIN_TOKEN) {\n return TOTAL_TOKEN_COUNT;\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_1228 | {
"fields": [
{
"declarator": "executor = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + \"executor-%s\"))",
"modifier": "private",
"original_string": "private ExecutorService executor = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + \"executor-%s\"));",... | {
"body": "@Test\n public void testSingleNode()\n {\n FixedCountScheduler nodeScheduler = new FixedCountScheduler(\n (node, partition, totalPartitions) -> Optional.of(taskFactory.createTableScanTask(\n new TaskId(\"test\", 1, 1),\n node, Immuta... | {
"fields": [
{
"declarator": "taskScheduler",
"modifier": "private final",
"original_string": "private final TaskScheduler taskScheduler;",
"type": "TaskScheduler",
"var_name": "taskScheduler"
},
{
"declarator": "partitionToNode",
"modifier": "private final",
... | {
"body": "@Override\n public ScheduleResult schedule()\n {\n OptionalInt totalPartitions = OptionalInt.of(partitionToNode.size());\n List<RemoteTask> newTasks = IntStream.range(0, partitionToNode.size())\n .mapToObj(partition -> taskScheduler.scheduleTask(partitionToNode.get(partit... | {
"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_44 | {
"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 testFilterSchemas()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-visibility.json\");\n\n assertEquals(accessControl.filterSchemas(ADMIN, \"specific-catalog\", ImmutableSet.of(\"specific-schema\", \"unknown\")), ... | {
"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 Set<String> filterSchemas(SystemSecurityContext context, String catalogName, Set<String> schemaNames)\n {\n return schemaNames.stream()\n .filter(schemaName -> checkAnySchemaAccess(context, catalogName, schemaName))\n .collect(toImmutableSet());... | {
"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_831 | {
"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 testPower()\n {\n for (long left : intLefts) {\n for (long right : intRights) {\n assertFunction(\"power(\" + left + \", \" + right + \")\", DOUBLE, Math.pow(left, right));\n }\n }\n\n for (int left : intLefts) {\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(\"Value raised to the power of exponent\")\n @ScalarFunction(alias = \"pow\")\n @SqlType(StandardTypes.DOUBLE)\n public static double power(@SqlType(StandardTypes.DOUBLE) double num, @SqlType(StandardTypes.DOUBLE) double exponent)\n {\n return Math.pow(num, exponent);\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_974 | {
"fields": [
{
"declarator": "COST_COMPARATOR = new CostComparator(1, 1, 1)",
"modifier": "private static final",
"original_string": "private static final CostComparator COST_COMPARATOR = new CostComparator(1, 1, 1);",
"type": "CostComparator",
"var_name": "COST_COMPARATOR"
},
... | {
"body": "@Test\n public void testGetSourceTablesSizeInBytes()\n {\n PlanBuilder planBuilder = new PlanBuilder(new PlanNodeIdAllocator(), tester.getMetadata());\n Symbol symbol = planBuilder.symbol(\"col\");\n Symbol sourceSymbol1 = planBuilder.symbol(\"source1\");\n Symbol sourceSy... | {
"fields": [
{
"declarator": "PATTERN = join().matching(joinNode -> joinNode.getDistributionType().isEmpty())",
"modifier": "private static final",
"original_string": "private static final Pattern<JoinNode> PATTERN = join().matching(joinNode -> joinNode.getDistributionType().isEmpty());",
... | {
"body": "public static double getSourceTablesSizeInBytes(PlanNode node, Context context)\n {\n return getSourceTablesSizeInBytes(node, context.getLookup(), context.getStatsProvider(), context.getSymbolAllocator().getTypes());\n }",
"class_method_signature": "DetermineJoinDistributionType.getSourceTab... | {
"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_427 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/statistics/TestDoubleRange.java",
"identifier": "TestDoubleRange",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnion()\n {\n assertEquals(union(new DoubleRange(1, 2), new DoubleRange(4, 5)), new DoubleRange(1, 5));\n assertEquals(union(new DoubleRange(1, 2), new DoubleRange(1, 2)), new DoubleRange(1, 2));\n assertEquals(union(new DoubleRange(4, 5), new DoubleRange(... | {
"fields": [
{
"declarator": "min",
"modifier": "private final",
"original_string": "private final double min;",
"type": "double",
"var_name": "min"
},
{
"declarator": "max",
"modifier": "private final",
"original_string": "private final double max;",
... | {
"body": "public static DoubleRange union(DoubleRange first, DoubleRange second)\n {\n requireNonNull(first, \"first is null\");\n requireNonNull(second, \"second is null\");\n return new DoubleRange(min(first.min, second.min), max(first.max, second.max));\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_1044 | {
"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 testParenthesedRecursionStep()\n {\n analyze(\"WITH RECURSIVE t(n) AS (\" +\n \" SELECT 1\" +\n \" UNION ALL\" +\n \" (((SELECT n + 2 FROM t WHERE n < 6)))\" +\n \" )\" +\n ... | {
"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_1101 | {
"fields": [
{
"declarator": "TEST_HEADERS = new GuavaMultivaluedMap<>(ImmutableListMultimap.<String, String>builder()\n .put(PRESTO_USER, \"testUser\")\n .put(PRESTO_SOURCE, \"testSource\")\n .put(PRESTO_CATALOG, \"testCatalog\")\n .put(PRESTO_SCHEMA, \"testSche... | {
"body": "@Test\n public void testCreateSession()\n {\n SessionContext context = new HttpRequestSessionContext(TEST_HEADERS, \"testRemote\", Optional.empty(), user -> ImmutableSet.of());\n QuerySessionSupplier sessionSupplier = createSessionSupplier(new SqlEnvironmentConfig());\n Session s... | {
"fields": [
{
"declarator": "transactionManager",
"modifier": "private final",
"original_string": "private final TransactionManager transactionManager;",
"type": "TransactionManager",
"var_name": "transactionManager"
},
{
"declarator": "accessControl",
"modifier... | {
"body": "@Override\n public Session createSession(QueryId queryId, SessionContext context)\n {\n Identity identity = context.getIdentity();\n accessControl.checkCanSetUser(identity.getPrincipal(), identity.getUser());\n\n // authenticated identity is not present for HTTP or if authenticat... | {
"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_13 | {
"fields": [],
"file": "presto-session-property-managers/src/test/java/io/prestosql/plugin/session/file/TestFileSessionPropertyManagerConfig.java",
"identifier": "TestFileSessionPropertyManagerConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n throws IOException\n {\n Path configFile = Files.createTempFile(null, null);\n\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"session-property-manager.config-file\", co... | {
"fields": [
{
"declarator": "configFile",
"modifier": "private",
"original_string": "private File configFile;",
"type": "File",
"var_name": "configFile"
}
],
"file": "presto-session-property-managers/src/main/java/io/prestosql/plugin/session/file/FileSessionPropertyManagerC... | {
"body": "@Config(\"session-property-manager.config-file\")\n public FileSessionPropertyManagerConfig setConfigFile(File configFile)\n {\n this.configFile = configFile;\n return this;\n }",
"class_method_signature": "FileSessionPropertyManagerConfig.setConfigFile(File configFile)",
"constr... | {
"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_866 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCharSubstring()\n {\n assertFunction(\"SUBSTR(CAST('Quadratically' AS CHAR(13)), 5)\", createVarcharType(13), \"ratically\");\n assertFunction(\"SUBSTR(CAST('Quadratically' AS CHAR(13)), 50)\", createVarcharType(13), \"\");\n assertFunction(\"SUBSTR(CAST('... | {
"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(\"Suffix starting at given index\")\n @ScalarFunction(value = \"substring\", alias = \"substr\")\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice charSubstring(@LiteralParameter(\"x\") Long x, @SqlType(\"char(x)\") Slice utf8, @SqlType(StandardTypes.BIGI... | {
"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_535 | {
"fields": [
{
"declarator": "ENVIRONMENT = \"test\"",
"modifier": "private static final",
"original_string": "private static final String ENVIRONMENT = \"test\";",
"type": "String",
"var_name": "ENVIRONMENT"
},
{
"declarator": "EMPTY_RESOURCE_ESTIMATES = new ResourceE... | {
"body": "@Test\n public void testConfiguration()\n {\n H2DaoProvider daoProvider = setup(\"test_configuration\");\n H2ResourceGroupsDao dao = daoProvider.get();\n dao.createResourceGroupsGlobalPropertiesTable();\n dao.createResourceGroupsTable();\n dao.createSelectorsTable()... | {
"fields": [
{
"declarator": "log = Logger.get(DbResourceGroupConfigurationManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(DbResourceGroupConfigurationManager.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public void configure(ResourceGroup group, SelectionContext<ResourceGroupIdTemplate> criteria)\n {\n ResourceGroupSpec groupSpec = getMatchingSpec(group, criteria);\n if (groups.putIfAbsent(group.getId(), group) == null) {\n // If a new spec replaces the spec retu... | {
"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_165 | {
"fields": [
{
"declarator": "partitionDirectory",
"modifier": "private",
"original_string": "private Path partitionDirectory;",
"type": "Path",
"var_name": "partitionDirectory"
},
{
"declarator": "rowIdBlock",
"modifier": "private",
"original_string": "pri... | {
"body": "@Test\n public void testDeletedLocationsOriginalFiles()\n {\n Path path = new Path(TestOrcDeletedRows.class.getClassLoader().getResource(\"dummy_id_data_orc\") + \"/\");\n AcidInfo.Builder acidInfoBuilder = AcidInfo.builder(path);\n addDeleteDelta(acidInfoBuilder, 10000001L, 1000... | {
"fields": [
{
"declarator": "ORIGINAL_TRANSACTION_INDEX = 0",
"modifier": "private static final",
"original_string": "private static final int ORIGINAL_TRANSACTION_INDEX = 0;",
"type": "int",
"var_name": "ORIGINAL_TRANSACTION_INDEX"
},
{
"declarator": "ROW_ID_INDEX = ... | {
"body": "public MaskDeletedRowsFunction getMaskDeletedRowsFunction(Page sourcePage, OptionalLong startRowId)\n {\n return new MaskDeletedRows(sourcePage, startRowId);\n }",
"class_method_signature": "OrcDeletedRows.getMaskDeletedRowsFunction(Page sourcePage, OptionalLong startRowId)",
"constructor"... | {
"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_470 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestEquatableValueSet.java",
"identifier": "TestEquatableValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOverlaps()\n {\n assertTrue(EquatableValueSet.all(ID).overlaps(EquatableValueSet.all(ID)));\n assertFalse(EquatableValueSet.all(ID).overlaps(EquatableValueSet.none(ID)));\n assertTrue(EquatableValueSet.all(ID).overlaps(EquatableValueSet.of(ID, 0L)));\n ... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "inclusive",
"modifier": "private final",
"original_string": "private final boolean inclus... | {
"body": "@Override\n public boolean overlaps(ValueSet other)\n {\n EquatableValueSet otherValueSet = checkCompatibility(other);\n\n if (inclusive && otherValueSet.inclusive()) {\n return setsOverlap(entries, otherValueSet.entries);\n }\n else if (inclusive) {\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_889 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestArrayCombinationsFunction.java",
"identifier": "TestArrayCombinationsFunction",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCombinationCount()\n {\n for (int n = 0; n < 5; n++) {\n for (int k = 0; k <= n; k++) {\n assertEquals(combinationCount(n, k), factorial(n) / factorial(n - k) / factorial(k));\n }\n }\n\n assertEquals(combinationCount(4... | {
"fields": [
{
"declarator": "MAX_COMBINATION_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MAX_COMBINATION_LENGTH = 5;",
"type": "int",
"var_name": "MAX_COMBINATION_LENGTH"
},
{
"declarator": "MAX_RESULT_ELEMENTS = 100_0... | {
"body": "@VisibleForTesting\n static int combinationCount(int arrayLength, int combinationLength)\n {\n try {\n /*\n * Then combinationCount(n, k) = combinationCount(n-1, k-1) * n/k (https://en.wikipedia.org/wiki/Combination#Number_of_k-combinations)\n * The formula 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_923 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/TestCompilerConfig.java",
"identifier": "TestCompilerConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(CompilerConfig.class)\n .setExpressionCacheSize(10_000));\n }",
"class_method_signature": "TestCompilerConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public void testD... | {
"fields": [
{
"declarator": "expressionCacheSize = 10_000",
"modifier": "private",
"original_string": "private int expressionCacheSize = 10_000;",
"type": "int",
"var_name": "expressionCacheSize"
}
],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/CompilerConfi... | {
"body": "@Config(\"compiler.expression-cache-size\")\n @Description(\"Reuse compiled expressions across multiple queries\")\n public CompilerConfig setExpressionCacheSize(int expressionCacheSize)\n {\n this.expressionCacheSize = expressionCacheSize;\n return this;\n }",
"class_method_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_309 | {
"fields": [
{
"declarator": "TOLERANCE = 0.01",
"modifier": "private static final",
"original_string": "private static final double TOLERANCE = 0.01;",
"type": "double",
"var_name": "TOLERANCE"
},
{
"declarator": "SUPPORTED_SCHEMAS = ImmutableList.of(\"tiny\", \"sf1\"... | {
"body": "@Test\n public void testTableStatsWithConstraints()\n {\n SUPPORTED_SCHEMAS.forEach(schema -> {\n double scaleFactor = TpchMetadata.schemaNameToScaleFactor(schema);\n\n testTableStats(schema, ORDERS, alwaysFalse(), 0);\n testTableStats(schema, ORDERS, constrain... | {
"fields": [
{
"declarator": "TINY_SCHEMA_NAME = \"tiny\"",
"modifier": "public static final",
"original_string": "public static final String TINY_SCHEMA_NAME = \"tiny\";",
"type": "String",
"var_name": "TINY_SCHEMA_NAME"
},
{
"declarator": "TINY_SCALE_FACTOR = 0.01",
... | {
"body": "public static double schemaNameToScaleFactor(String schemaName)\n {\n if (TINY_SCHEMA_NAME.equals(schemaName)) {\n return TINY_SCALE_FACTOR;\n }\n\n if (!schemaName.startsWith(\"sf\")) {\n return -1;\n }\n\n try {\n return Double.parseD... | {
"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_759 | {
"fields": [
{
"declarator": "TYPES = ImmutableList.of(BIGINT, REAL, DOUBLE)",
"modifier": "private static final",
"original_string": "private static final List<Type> TYPES = ImmutableList.of(BIGINT, REAL, DOUBLE);",
"type": "List<Type>",
"var_name": "TYPES"
}
],
"file": "pr... | {
"body": "@Test\n public void testMinRowCountThreshold()\n {\n Page page = createSequencePage(TYPES, 10);\n\n WorkProcessor<Page> mergePages = mergePages(\n TYPES,\n 1024 * 1024,\n page.getPositionCount(),\n Integer.MAX_VALUE,\n ... | {
"fields": [
{
"declarator": "MAX_MIN_PAGE_SIZE = 1024 * 1024",
"modifier": "private static final",
"original_string": "private static final int MAX_MIN_PAGE_SIZE = 1024 * 1024;",
"type": "int",
"var_name": "MAX_MIN_PAGE_SIZE"
}
],
"file": "presto-main/src/main/java/io/prest... | {
"body": "private MergePages() {}",
"class_method_signature": "MergePages.MergePages()",
"constructor": true,
"full_signature": "private MergePages()",
"identifier": "MergePages",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " MergePages()",
"testcase... | {
"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_1013 | {
"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 testAsteriskedIdentifierChainResolution()\n {\n // identifier chain of length 2; match to table and field in immediate scope\n assertFails(CLIENT_SESSION_FOR_IDENTIFIER_CHAIN_TESTS, \"SELECT a.b.* FROM a.b, t1 AS a\")\n .hasErrorCode(AMBIGUOUS_NAME);\n... | {
"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_1156 | {
"fields": [
{
"declarator": "idGeneator = new AtomicInteger()",
"modifier": "private final",
"original_string": "private final AtomicInteger idGeneator = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "idGeneator"
},
{
"declarator": "session = TestingSess... | {
"body": "@Test\n public void testScheduleMemoryRevoking()\n throws Exception\n {\n SqlTask sqlTask1 = newSqlTask();\n SqlTask sqlTask2 = newSqlTask();\n\n TaskContext taskContext1 = sqlTask1.getQueryContext().addTaskContext(new TaskStateMachine(new TaskId(\"q1\", 1, 1), executo... | {
"fields": [
{
"declarator": "log = Logger.get(MemoryRevokingScheduler.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(MemoryRevokingScheduler.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator":... | {
"body": "private void requestMemoryRevoking(MemoryPool memoryPool, Collection<SqlTask> sqlTasks)\n {\n long remainingBytesToRevoke = (long) (-memoryPool.getFreeBytes() + (memoryPool.getMaxBytes() * (1.0 - memoryRevokingTarget)));\n remainingBytesToRevoke -= getMemoryAlreadyBeingRevoked(sqlTasks, me... | {
"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_489 | {
"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 testTransform()\n {\n Map<Integer, Domain> domains = ImmutableMap.<Integer, Domain>builder()\n .put(1, Domain.singleValue(BIGINT, 1L))\n .put(2, Domain.singleValue(BIGINT, 2L))\n .put(3, Domain.singleValue(BIGINT, 3L))\n ... | {
"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": "public <U> TupleDomain<U> transform(Function<T, U> function)\n {\n if (isNone()) {\n return none();\n }\n if (isAll()) {\n return all();\n }\n\n Map<T, Domain> domains = this.domains.orElseThrow();\n HashMap<U, Domain> result = new LinkedHa... | {
"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_173 | {
"fields": [
{
"declarator": "LAZY_SERDE_CLASS_NAME = LazySimpleSerDe.class.getName()",
"modifier": "private static final",
"original_string": "private static final String LAZY_SERDE_CLASS_NAME = LazySimpleSerDe.class.getName();",
"type": "String",
"var_name": "LAZY_SERDE_CLASS_NAME... | {
"body": "@Test(expectedExceptions = NullPointerException.class)\n public void shouldThrowNullPointerExceptionWhenSchemaIsNull()\n {\n updateSplitSchema(null, ImmutableList.of());\n }",
"class_method_signature": "TestS3SelectRecordCursor.shouldThrowNullPointerExceptionWhenSchemaIsNull()",
"constr... | {
"fields": [
{
"declarator": "THRIFT_STRUCT = \"struct\"",
"modifier": "private static final",
"original_string": "private static final String THRIFT_STRUCT = \"struct\";",
"type": "String",
"var_name": "THRIFT_STRUCT"
},
{
"declarator": "START_STRUCT = \"{\"",
"... | {
"body": "@VisibleForTesting\n static Properties updateSplitSchema(Properties splitSchema, List<HiveColumnHandle> columns)\n {\n requireNonNull(splitSchema, \"splitSchema is null\");\n requireNonNull(columns, \"columns is null\");\n // clone split properties for update so as not to affect ... | {
"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_523 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestCsvPrinter.java",
"identifier": "TestCsvPrinter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCsvPrintingNoRows()\n throws Exception\n {\n StringWriter writer = new StringWriter();\n List<String> fieldNames = ImmutableList.of(\"first\", \"last\");\n OutputPrinter printer = new CsvPrinter(fieldNames, writer, STANDARD);\n\n printer.... | {
"fields": [
{
"declarator": "fieldNames",
"modifier": "private final",
"original_string": "private final List<String> fieldNames;",
"type": "List<String>",
"var_name": "fieldNames"
},
{
"declarator": "writer",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public void finish()\n throws IOException\n {\n printRows(ImmutableList.of(), true);\n writer.flush();\n checkError();\n }",
"class_method_signature": "CsvPrinter.finish()",
"constructor": false,
"full_signature": "@Override public void finish()",
... | {
"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_1269 | {
"fields": [],
"file": "presto-bigquery/src/test/java/io/prestosql/plugin/bigquery/TestReadRowsHelper.java",
"identifier": "TestReadRowsHelper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testRetryOfSingleFailure()\n {\n BigQueryStorageClient client = mock(BigQueryStorageClient.class);\n ReadRowsRequest.Builder request = newRequest();\n\n MockResponsesBatch batch1 = new MockResponsesBatch();\n batch1.addResponse(ReadRowsResponse.newBuilder().se... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final BigQueryStorageClient client;",
"type": "BigQueryStorageClient",
"var_name": "client"
},
{
"declarator": "request",
"modifier": "private final",
"original_... | {
"body": "public Iterator<ReadRowsResponse> readRows()\n {\n Iterator<ReadRowsResponse> serverResponses = fetchResponses(request);\n return new ReadRowsIterator(this, request.getReadPositionBuilder(), serverResponses);\n }",
"class_method_signature": "ReadRowsHelper.readRows()",
"constructor"... | {
"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_870 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCharLeftTrim()\n {\n assertFunction(\"LTRIM(CAST('' AS CHAR(20)))\", createCharType(20), padRight(\"\", 20));\n assertFunction(\"LTRIM(CAST(' hello ' AS CHAR(9)))\", createCharType(9), padRight(\"hello\", 9));\n assertFunction(\"LTRIM(CAST(' hello' AS C... | {
"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(\"Removes whitespace from the beginning of a string\")\n @ScalarFunction(\"ltrim\")\n @LiteralParameters(\"x\")\n @SqlType(\"char(x)\")\n public static Slice charLeftTrim(@SqlType(\"char(x)\") Slice slice)\n {\n return SliceUtf8.leftTrim(slice);\n }",
"class_method_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_935 | {
"fields": [
{
"declarator": "idAllocator = new PlanNodeIdAllocator()",
"modifier": "private final",
"original_string": "private final PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();",
"type": "PlanNodeIdAllocator",
"var_name": "idAllocator"
},
{
"declarat... | {
"body": "@Test(expectedExceptions = IllegalStateException.class)\n public void testValidateFailed()\n {\n // random plan with 2 output nodes\n PlanNode root =\n new OutputNode(idAllocator.getNextId(),\n new ExplainAnalyzeNode(idAllocator.getNextId(),\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/sanity/VerifyOnlyOneOutputNode.java",
"identifier": "VerifyOnlyOneOutputNode",
"interfaces": "implements PlanSanityChecker.Checker",
"methods": [
{
"class_method_signature": "VerifyOnlyOneOutputNode.validate(PlanNode plan,\n... | {
"body": "@Override\n public void validate(PlanNode plan,\n Session session,\n Metadata metadata,\n TypeOperators typeOperators,\n TypeAnalyzer typeAnalyzer,\n TypeProvider types,\n WarningCollector warningCollector)\n {\n int outputPlanN... | {
"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_466 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestSortedRangeSet.java",
"identifier": "TestSortedRangeSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testContainsValue()\n {\n // BIGINT all\n assertSortedRangeSet(SortedRangeSet.all(BIGINT))\n .containsValue(Long.MIN_VALUE)\n .containsValue(0L)\n .containsValue(42L)\n .containsValue(Long.MAX_VALUE);\n\n ... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "lowIndexedRanges",
"modifier": "private final",
"original_string": "private final Navigab... | {
"body": "@Override\n public boolean containsValue(Object value)\n {\n if (isFloatingPointNaN(type, value)) {\n return isAll();\n }\n return includesMarker(Marker.exactly(type, value));\n }",
"class_method_signature": "SortedRangeSet.containsValue(Object 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_1005 | {
"fields": [
{
"declarator": "typeOperators = new TypeOperators()",
"modifier": "private static final",
"original_string": "private static final TypeOperators typeOperators = new TypeOperators();",
"type": "TypeOperators",
"var_name": "typeOperators"
},
{
"declarator":... | {
"body": "@Test(dataProvider = \"hashEnabledValues\")\n public void testSingleChannel(boolean hashEnabled)\n {\n List<Type> joinTypes = ImmutableList.of(VARCHAR);\n List<Integer> joinChannels = Ints.asList(0);\n\n // compile a single channel hash strategy\n PagesHashStrategyFactory ... | {
"fields": [
{
"declarator": "typeOperators",
"modifier": "private final",
"original_string": "private final TypeOperators typeOperators;",
"type": "TypeOperators",
"var_name": "typeOperators"
},
{
"declarator": "lookupSourceFactories = CacheBuilder.newBuilder()\n ... | {
"body": "public PagesHashStrategyFactory compilePagesHashStrategyFactory(List<Type> types, List<Integer> joinChannels)\n {\n return compilePagesHashStrategyFactory(types, joinChannels, Optional.empty());\n }",
"class_method_signature": "JoinCompiler.compilePagesHashStrategyFactory(List<Type> types, L... | {
"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_1140 | {
"fields": [
{
"declarator": "SQL_PARSER = new SqlParser()",
"modifier": "private static final",
"original_string": "private static final SqlParser SQL_PARSER = new SqlParser();",
"type": "SqlParser",
"var_name": "SQL_PARSER"
},
{
"declarator": "QUERY_PREPARER = new Qu... | {
"body": "@Test\n public void testExecuteStatement()\n {\n Session session = testSessionBuilder()\n .addPreparedStatement(\"my_query\", \"SELECT * FROM foo\")\n .build();\n PreparedQuery preparedQuery = QUERY_PREPARER.prepareQuery(session, \"EXECUTE my_query\");\n ... | {
"fields": [
{
"declarator": "sqlParser",
"modifier": "private final",
"original_string": "private final SqlParser sqlParser;",
"type": "SqlParser",
"var_name": "sqlParser"
}
],
"file": "presto-main/src/main/java/io/prestosql/execution/QueryPreparer.java",
"identifier": "Q... | {
"body": "public PreparedQuery prepareQuery(Session session, String query)\n throws ParsingException, PrestoException\n {\n Statement wrappedStatement = sqlParser.createStatement(query, createParsingOptions(session));\n return prepareQuery(session, wrappedStatement);\n }",
"class_met... | {
"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_827 | {
"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 testInfinity()\n {\n assertFunction(\"infinity()\", DOUBLE, Double.POSITIVE_INFINITY);\n assertFunction(\"-rand() / 0.0\", DOUBLE, Double.NEGATIVE_INFINITY);\n }",
"class_method_signature": "TestMathFunctions.testInfinity()",
"constructor": false,
"full_sign... | {
"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(\"Infinity\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double infinity()\n {\n return Double.POSITIVE_INFINITY;\n }",
"class_method_signature": "MathFunctions.infinity()",
"constructor": false,
"full_signature": "@Description(\"Infinity\") ... | {
"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_52 | {
"fields": [
{
"declarator": "timestampTester = new JsonFieldDecoderTester(\"custom-date-time\", \"MM/yyyy/dd H:m:s\")",
"modifier": "private final",
"original_string": "private final JsonFieldDecoderTester timestampTester = new JsonFieldDecoderTester(\"custom-date-time\", \"MM/yyyy/dd H:m:s\")... | {
"body": "@Test\n public void testDecode()\n {\n timestampTester.assertDecodedAs(\"\\\"02/2018/19 9:20:11\\\"\", TIMESTAMP_MILLIS, 1_519_032_011_000_000L);\n timestampWithTimeZoneTester.assertDecodedAs(\"\\\"02/2018/19 11:20:11 +02:00\\\"\", TIMESTAMP_MILLIS, 1_519_032_011_000_000L);\n tim... | {
"fields": [
{
"declarator": "SUPPORTED_TYPES = ImmutableSet.of(DATE, TIME, TIME_WITH_TIME_ZONE, TIMESTAMP_MILLIS, TIMESTAMP_WITH_TIME_ZONE)",
"modifier": "private static final",
"original_string": "private static final Set<Type> SUPPORTED_TYPES = ImmutableSet.of(DATE, TIME, TIME_WITH_TIME_ZONE... | {
"body": "@Override\n public FieldValueProvider decode(JsonNode value)\n {\n return new CustomDateTimeJsonValueProvider(value, columnHandle, formatter);\n }",
"class_method_signature": "CustomDateTimeJsonFieldDecoder.decode(JsonNode value)",
"constructor": false,
"full_signature": "@Override pu... | {
"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_574 | {
"fields": [
{
"declarator": "IDENTITY = JdbcIdentity.from(SESSION)",
"modifier": "private static final",
"original_string": "private static final JdbcIdentity IDENTITY = JdbcIdentity.from(SESSION);",
"type": "JdbcIdentity",
"var_name": "IDENTITY"
}
],
"file": "presto-base-j... | {
"body": "@Test\n public void testRetryAndReturn()\n throws Exception\n {\n MockConnectorFactory mock = new MockConnectorFactory(THROW_SQL_RECOVERABLE_EXCEPTION, RETURN);\n ConnectionFactory factory = new RetryingConnectionFactory(mock);\n assertNotNull(factory.openConnection(ID... | {
"fields": [
{
"declarator": "RETRY_POLICY = new RetryPolicy<>()\n .withMaxDuration(java.time.Duration.of(30, SECONDS))\n .withMaxAttempts(5)\n .withBackoff(50, 5_000, MILLIS, 4)\n .handleIf(RetryingConnectionFactory::isSqlRecoverableException)\n .abor... | {
"body": "@Override\n public Connection openConnection(JdbcIdentity identity)\n throws SQLException\n {\n try {\n return Failsafe.with(RETRY_POLICY)\n .get(() -> delegate.openConnection(identity));\n }\n catch (FailsafeException ex) {\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_124 | {
"fields": [
{
"declarator": "HTTP_RANGE_NOT_SATISFIABLE = 416",
"modifier": "private static final",
"original_string": "private static final int HTTP_RANGE_NOT_SATISFIABLE = 416;",
"type": "int",
"var_name": "HTTP_RANGE_NOT_SATISFIABLE"
}
],
"file": "presto-hive/src/test/ja... | {
"body": "@Test(expectedExceptions = VerifyException.class, expectedExceptionsMessageRegExp = \"Invalid configuration: either endpoint can be set or S3 client can be pinned to the current region\")\n public void testEndpointWithPinToCurrentRegionConfiguration()\n throws Exception\n {\n Config... | {
"fields": [
{
"declarator": "S3_USER_AGENT_SUFFIX = \"presto\"",
"modifier": "public static final",
"original_string": "public static final String S3_USER_AGENT_SUFFIX = \"presto\";",
"type": "String",
"var_name": "S3_USER_AGENT_SUFFIX"
},
{
"declarator": "S3_USER_AGE... | {
"body": "@Override\n public void initialize(URI uri, Configuration conf)\n throws IOException\n {\n requireNonNull(uri, \"uri is null\");\n requireNonNull(conf, \"conf is null\");\n super.initialize(uri, conf);\n setConf(conf);\n\n try {\n this.uri = ne... | {
"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_431 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestLongTimestamp.java",
"identifier": "TestLongTimestamp",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString()\n {\n assertEquals(new LongTimestamp(1600960182536000L, 0).toString(), \"2020-09-24 15:09:42.536000000000\");\n assertEquals(new LongTimestamp(1600960182536123L, 0).toString(), \"2020-09-24 15:09:42.536123000000\");\n assertEquals(new LongTimest... | {
"fields": [
{
"declarator": "PICOSECONDS_PER_MICROSECOND = 1_000_000",
"modifier": "private static final",
"original_string": "private static final int PICOSECONDS_PER_MICROSECOND = 1_000_000;",
"type": "int",
"var_name": "PICOSECONDS_PER_MICROSECOND"
},
{
"declarator... | {
"body": "@Override\n public String toString()\n {\n return formatTimestamp(TimestampType.MAX_PRECISION, epochMicros, picosOfMicro);\n }",
"class_method_signature": "LongTimestamp.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toStrin... | {
"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_962 | {
"fields": [
{
"declarator": "idAllocator = new PlanNodeIdAllocator()",
"modifier": "private final",
"original_string": "private final PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();",
"type": "PlanNodeIdAllocator",
"var_name": "idAllocator"
}
],
"file": "presto... | {
"body": "@Test\n public void testJoinOrderWithRealCrossJoin()\n {\n PlanNode leftPlan =\n joinNode(\n joinNode(\n values(\"a\"),\n values(\"b\")),\n values(\"c\"),\n ... | {
"fields": [
{
"declarator": "PATTERN = join()",
"modifier": "private static final",
"original_string": "private static final Pattern<JoinNode> PATTERN = join();",
"type": "Pattern<JoinNode>",
"var_name": "PATTERN"
},
{
"declarator": "metadata",
"modifier": "priv... | {
"body": "public static List<Integer> getJoinOrder(JoinGraph graph)\n {\n ImmutableList.Builder<PlanNode> joinOrder = ImmutableList.builder();\n\n Map<PlanNodeId, Integer> priorities = new HashMap<>();\n for (int i = 0; i < graph.size(); i++) {\n priorities.put(graph.getNode(i).get... | {
"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_348 | {
"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 testGetSuperTables()\n throws Exception\n {\n try (Connection connection = createConnection()) {\n try (ResultSet rs = connection.getMetaData().getSuperTables(null, null, null)) {\n assertFalse(rs.next());\n }\n }\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 getSuperTables(String catalog, String schemaPattern, String tableNamePattern)\n throws SQLException\n {\n return selectEmpty(\"\" +\n \"SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, SUPERTABLE_NAME\\n\" +\n \"FROM system.jdbc.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_718 | {
"fields": [
{
"declarator": "METADATA = createTestMetadataManager()",
"modifier": "private static final",
"original_string": "private static final Metadata METADATA = createTestMetadataManager();",
"type": "Metadata",
"var_name": "METADATA"
},
{
"declarator": "SIGNATU... | {
"body": "@Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = \"two matching methods \\\\(varcharToBigintReturnFirstExtraParameter and varcharToBigintReturnExtraParameter\\\\) for parameter types \\\\[varchar\\\\(10\\\\)\\\\]\")\n public void testFailIfTwoMethodsWithSameArgum... | {
"fields": [
{
"declarator": "choices",
"modifier": "private final",
"original_string": "private final List<PolymorphicScalarFunctionChoice> choices;",
"type": "List<PolymorphicScalarFunctionChoice>",
"var_name": "choices"
}
],
"file": "presto-main/src/main/java/io/prestosql... | {
"body": "@Override\n protected ScalarFunctionImplementation specialize(FunctionBinding functionBinding)\n {\n ImmutableList.Builder<ScalarImplementationChoice> implementationChoices = ImmutableList.builder();\n\n for (PolymorphicScalarFunctionChoice choice : choices) {\n implementatio... | {
"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_1052 | {
"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 testCreateTable()\n {\n analyze(\"CREATE TABLE test (id bigint)\");\n analyze(\"CREATE TABLE test (id bigint) WITH (p1 = 'p1')\");\n\n assertFails(\"CREATE TABLE test (x bigint) WITH (p1 = y)\")\n .hasErrorCode(COLUMN_NOT_FOUND)\n ... | {
"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_1117 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/TestEmbeddedDiscoveryConfig.java",
"identifier": "TestEmbeddedDiscoveryConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"discovery-server.enabled\", \"true\")\n .build();\n\n EmbeddedDiscoveryConfig expected = new EmbeddedDiscoveryConfi... | {
"fields": [
{
"declarator": "enabled",
"modifier": "private",
"original_string": "private boolean enabled;",
"type": "boolean",
"var_name": "enabled"
}
],
"file": "presto-main/src/main/java/io/prestosql/server/EmbeddedDiscoveryConfig.java",
"identifier": "EmbeddedDiscover... | {
"body": "@Config(\"discovery-server.enabled\")\n public EmbeddedDiscoveryConfig setEnabled(boolean enabled)\n {\n this.enabled = enabled;\n return this;\n }",
"class_method_signature": "EmbeddedDiscoveryConfig.setEnabled(boolean enabled)",
"constructor": false,
"full_signature": "@Confi... | {
"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_59 | {
"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 testDecimalColumns()\n {\n TypeManager typeManager = this.typeManager;\n IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(typeManager);\n List<HiveColumnHandle> columns = ImmutableList.of(\n createBaseColumn(\"quantity\", 0, HiveType.val... | {
"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_1235 | {
"fields": [],
"file": "presto-pinot/src/test/java/io/prestosql/pinot/query/TestDynamicTable.java",
"identifier": "TestDynamicTable",
"interfaces": "",
"superclass": "extends TestPinotQueryBase"
} | {
"body": "@Test\n public void testFilterWithPushdownConstraint()\n {\n String tableName = realtimeOnlyTable.getTableName();\n String query = format(\"select FlightNum from %s limit 60\", tableName.toLowerCase(ENGLISH));\n DynamicTable dynamicTable = buildFromPql(pinotMetadata, new SchemaTa... | {
"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_986 | {
"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 testLimit()\n {\n PlanNode node = new LimitNode(\n newId(),\n filter(\n baseTableScan,\n and(\n equals(AE, BE),\n equals(BE, CE),\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_590 | {
"fields": [],
"file": "presto-rcfile/src/test/java/io/prestosql/rcfile/TestBufferedOutputStreamSliceOutput.java",
"identifier": "TestBufferedOutputStreamSliceOutput",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWriteBytes()\n throws Exception\n {\n // fill up some input bytes\n int length = 65536;\n byte[] inputArray = new byte[length];\n for (int i = 0; i < length; i++) {\n inputArray[i] = (byte) (i % 128);\n }\n\n // p... | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(BufferedOutputStreamSliceOutput.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final int INSTANCE_SIZE = ClassLayout.parseClass(BufferedOutputStreamSliceOutput.class).instanceSiz... | {
"body": "@Override\n public void writeBytes(Slice source)\n {\n writeBytes(source, 0, source.length());\n }",
"class_method_signature": "BufferedOutputStreamSliceOutput.writeBytes(Slice source)",
"constructor": false,
"full_signature": "@Override public void writeBytes(Slice source)",
"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_969 | {
"fields": [
{
"declarator": "zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) -> new LongLiteral(\"0\"))",
"modifier": "private",
"original_string": "private ExpressionRewriteRuleSet zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) ... | {
"body": "@Test\n public void testAggregationExpressionNotRewritten()\n {\n FunctionCall nowCall = new FunctionCallBuilder(tester().getMetadata())\n .setName(QualifiedName.of(\"now\"))\n .build();\n ExpressionRewriteRuleSet functionCallRewriter = new ExpressionRewrit... | {
"fields": [
{
"declarator": "rewriter",
"modifier": "private final",
"original_string": "private final ExpressionRewriter rewriter;",
"type": "ExpressionRewriter",
"var_name": "rewriter"
}
],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/Express... | {
"body": "public Rule<?> aggregationExpressionRewrite()\n {\n return new AggregationExpressionRewrite(rewriter);\n }",
"class_method_signature": "ExpressionRewriteRuleSet.aggregationExpressionRewrite()",
"constructor": false,
"full_signature": "public Rule<?> aggregationExpressionRewrite()",
"id... | {
"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_713 | {
"fields": [
{
"declarator": "METADATA = createTestMetadataManager()",
"modifier": "private static final",
"original_string": "private static final Metadata METADATA = createTestMetadataManager();",
"type": "Metadata",
"var_name": "METADATA"
},
{
"declarator": "SIGNATU... | {
"body": "@Test\n public void testSelectsMethodBasedOnArgumentTypes()\n throws Throwable\n {\n SqlScalarFunction function = new PolymorphicScalarFunctionBuilder(TestMethods.class)\n .signature(SIGNATURE)\n .deterministic(true)\n .choice(choice -> c... | {
"fields": [
{
"declarator": "choices",
"modifier": "private final",
"original_string": "private final List<PolymorphicScalarFunctionChoice> choices;",
"type": "List<PolymorphicScalarFunctionChoice>",
"var_name": "choices"
}
],
"file": "presto-main/src/main/java/io/prestosql... | {
"body": "@Override\n protected ScalarFunctionImplementation specialize(FunctionBinding functionBinding)\n {\n ImmutableList.Builder<ScalarImplementationChoice> implementationChoices = ImmutableList.builder();\n\n for (PolymorphicScalarFunctionChoice choice : choices) {\n implementatio... | {
"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_343 | {
"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 testGetTableTypes()\n throws Exception\n {\n try (Connection connection = createConnection()) {\n try (ResultSet tableTypes = connection.getMetaData().getTableTypes()) {\n assertThat(readRows(tableTypes))\n .isEqua... | {
"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 getTableTypes()\n throws SQLException\n {\n return select(\"\" +\n \"SELECT TABLE_TYPE\\n\" +\n \"FROM system.jdbc.table_types\\n\" +\n \"ORDER BY TABLE_TYPE\");\n }",
"class_method_signature": "PrestoDat... | {
"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_1059 | {
"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 testQualifiedViewColumnResolution()\n {\n // it should be possible to qualify the column reference with the view name\n analyze(\"SELECT v1.a FROM v1\");\n analyze(\"SELECT s1.v1.a FROM s1.v1\");\n analyze(\"SELECT tpch.s1.v1.a FROM tpch.s1.v1\");\n ... | {
"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_656 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java",
"identifier": "TestTinyintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testDivide()\n {\n assertFunction(\"TINYINT'37' / TINYINT'37'\", TINYINT, (byte) 1);\n assertFunction(\"TINYINT'37' / TINYINT'17'\", TINYINT, (byte) (37 / 17));\n assertFunction(\"TINYINT'17' / TINYINT'37'\", TINYINT, (byte) (17 / 37));\n assertFunction... | {
"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(DIVIDE)\n @SqlType(StandardTypes.TINYINT)\n public static long divide(@SqlType(StandardTypes.TINYINT) long left, @SqlType(StandardTypes.TINYINT) long right)\n {\n try {\n return left / right;\n }\n catch (ArithmeticException e) {\n throw 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_206 | {
"fields": [
{
"declarator": "BCRYPT_PASSWORD = \"$2y$10$BqTb8hScP5DfcpmHo5PeyugxHz5Ky/qf3wrpD7SNm8sWuA3VlGqsa\"",
"modifier": "private static final",
"original_string": "private static final String BCRYPT_PASSWORD = \"$2y$10$BqTb8hScP5DfcpmHo5PeyugxHz5Ky/qf3wrpD7SNm8sWuA3VlGqsa\";",
"typ... | {
"body": "@Test\n public void testInvalidFile()\n {\n assertThatThrownBy(() -> createStore(\"\", \"junk\"))\n .hasMessage(\"Error in password file line 2: Expected two parts for user and password\");\n\n assertThatThrownBy(() -> createStore(\"abc:\" + BCRYPT_PASSWORD, \"xyz:\" + BC... | {
"fields": [
{
"declarator": "LINE_SPLITTER = Splitter.on(\":\").limit(2)",
"modifier": "private static final",
"original_string": "private static final Splitter LINE_SPLITTER = Splitter.on(\":\").limit(2);",
"type": "Splitter",
"var_name": "LINE_SPLITTER"
},
{
"declar... | {
"body": "private static RuntimeException invalidFile(int lineNumber, String message, Throwable cause)\n {\n return new PrestoException(CONFIGURATION_INVALID, format(\"Error in password file line %s: %s\", lineNumber, message), cause);\n }",
"class_method_signature": "PasswordStore.invalidFile(int lin... | {
"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_528 | {
"fields": [],
"file": "presto-kudu/src/test/java/io/prestosql/plugin/kudu/TestKuduPlugin.java",
"identifier": "TestKuduPlugin",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateConnector()\n {\n Plugin plugin = new KuduPlugin();\n ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());\n factory.create(\"test\", ImmutableMap.of(\"kudu.client.master-addresses\", \"localhost:7051\"), new TestingConnectorCon... | {
"fields": [],
"file": "presto-kudu/src/main/java/io/prestosql/plugin/kudu/KuduPlugin.java",
"identifier": "KuduPlugin",
"interfaces": "implements Plugin",
"methods": [
{
"class_method_signature": "KuduPlugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Override p... | {
"body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new KuduConnectorFactory());\n }",
"class_method_signature": "KuduPlugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Override public Iterable<ConnectorFactory> g... | {
"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_482 | {
"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 testColumnWiseUnion()\n {\n TupleDomain<ColumnHandle> tupleDomain1 = TupleDomain.withColumnDomains(\n ImmutableMap.<ColumnHandle, Domain>builder()\n .put(A, Domain.all(VARCHAR))\n .put(B, Domain.notNull(DOUBLE))\n... | {
"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": "@SafeVarargs\n public static <T> TupleDomain<T> columnWiseUnion(TupleDomain<T> first, TupleDomain<T> second, TupleDomain<T>... rest)\n {\n List<TupleDomain<T>> domains = new ArrayList<>(rest.length + 2);\n domains.add(first);\n domains.add(second);\n domains.addAll(Arrays.... | {
"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_178 | {
"fields": [
{
"declarator": "BUCKET_COUNT = 2",
"modifier": "private static final",
"original_string": "private static final int BUCKET_COUNT = 2;",
"type": "int",
"var_name": "BUCKET_COUNT"
},
{
"declarator": "TIMESTAMP_PRECISION = 3",
"modifier": "private stat... | {
"body": "@Test(dataProvider = \"testPropagateExceptionDataProvider\", timeOut = 60_000)\n public void testPropagateException(boolean error, int threads)\n {\n AtomicBoolean iteratorUsedAfterException = new AtomicBoolean();\n\n BackgroundHiveSplitLoader backgroundHiveSplitLoader = new BackgroundH... | {
"fields": [
{
"declarator": "BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\")",
"modifier": "private static final",
"original_string": "private static final Pattern BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\"... | {
"body": "@Override\n public void start(HiveSplitSource splitSource)\n {\n this.hiveSplitSource = splitSource;\n this.stopwatch = Stopwatch.createStarted();\n for (int i = 0; i < loaderConcurrency; i++) {\n ListenableFuture<?> future = ResumableTasks.submit(executor, new HiveSpl... | {
"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_1262 | {
"fields": [
{
"declarator": "POSITION_COUNT = 50000",
"modifier": "private static final",
"original_string": "private static final int POSITION_COUNT = 50000;",
"type": "int",
"var_name": "POSITION_COUNT"
},
{
"declarator": "tempFile",
"modifier": "private",
... | {
"body": "@Test\n public void testTinyStripesReadCacheAt()\n throws IOException\n {\n DataSize maxMergeDistance = DataSize.of(1, Unit.MEGABYTE);\n DataSize tinyStripeThreshold = DataSize.of(8, Unit.MEGABYTE);\n\n TestingOrcDataSource testingOrcDataSource = new TestingOrcDataSour... | {
"fields": [
{
"declarator": "dataSource",
"modifier": "private final",
"original_string": "private final OrcDataSource dataSource;",
"type": "OrcDataSource",
"var_name": "dataSource"
},
{
"declarator": "regionFinder",
"modifier": "private final",
"original... | {
"body": "@VisibleForTesting\n void readCacheAt(long offset)\n throws IOException\n {\n DiskRange newCacheRange = regionFinder.getRangeFor(offset);\n cachePosition = newCacheRange.getOffset();\n cacheLength = newCacheRange.getLength();\n cache = dataSource.readFully(newCa... | {
"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_894 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestColorFunctions.java",
"identifier": "TestColorFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testRenderBoolean()\n {\n assertEquals(render(true), toSlice(\"\\u001b[38;5;2m✓\\u001b[0m\"));\n assertEquals(render(false), toSlice(\"\\u001b[38;5;1m✗\\u001b[0m\"));\n }",
"class_method_signature": "TestColorFunctions.testRenderBoolean()",
"constructor": fals... | {
"fields": [
{
"declarator": "ANSI_RESET = \"\\u001b[0m\"",
"modifier": "private static final",
"original_string": "private static final String ANSI_RESET = \"\\u001b[0m\";",
"type": "String",
"var_name": "ANSI_RESET"
},
{
"declarator": "RENDERED_TRUE = render(utf8Slic... | {
"body": "@ScalarFunction\n @LiteralParameters({\"x\", \"y\"})\n @Constraint(variable = \"y\", expression = \"min(2147483647, x + 15)\")\n // Color formatting uses 15 characters. Note that if the ansiColorEscape function implementation\n // changes, this value may be invalidated.\n @SqlType(\"varchar(... | {
"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_197 | {
"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(expectedExceptions = AccessDeniedException.class, description = \"Test got wrong org for real, yo!\")\n void createAuthenticatedPrincipalRealWrongOrg()\n {\n // Skip this test if SALESFORCE_TEST_FORREAL is not set to TRUE.\n if (!forReal) {\n throw new SkipException(\"S... | {
"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_314 | {
"fields": [],
"file": "presto-example-http/src/test/java/io/prestosql/plugin/example/TestExampleConfig.java",
"identifier": "TestExampleConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"metadata-uri\", \"file://test.json\")\n .build();\n\n ExampleConfig expected = new ExampleConfig()\n ... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private URI metadata;",
"type": "URI",
"var_name": "metadata"
}
],
"file": "presto-example-http/src/main/java/io/prestosql/plugin/example/ExampleConfig.java",
"identifier": "ExampleConfig",... | {
"body": "@Config(\"metadata-uri\")\n public ExampleConfig setMetadata(URI metadata)\n {\n this.metadata = metadata;\n return this;\n }",
"class_method_signature": "ExampleConfig.setMetadata(URI metadata)",
"constructor": false,
"full_signature": "@Config(\"metadata-uri\") public Example... | {
"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_744 | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(GroupedTopNBuilder.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final long INSTANCE_SIZE = ClassLayout.parseClass(GroupedTopNBuilder.class).instanceSize();",
"type": "lon... | {
"body": "@Test\n public void testEmptyInput()\n {\n GroupedTopNBuilder groupedTopNBuilder = new GroupedTopNBuilder(\n ImmutableList.of(BIGINT),\n (left, leftPosition, right, rightPosition) -> {\n throw new UnsupportedOperationException();\n ... | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(GroupedTopNBuilder.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final long INSTANCE_SIZE = ClassLayout.parseClass(GroupedTopNBuilder.class).instanceSize();",
"type": "lon... | {
"body": "public Iterator<Page> buildResult()\n {\n return new ResultIterator();\n }",
"class_method_signature": "GroupedTopNBuilder.buildResult()",
"constructor": false,
"full_signature": "public Iterator<Page> buildResult()",
"identifier": "buildResult",
"invocations": [],
"modifiers": "pu... | {
"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_251 | {
"fields": [
{
"declarator": "UTC_CHRONOLOGY = ISOChronology.getInstanceUTC()",
"modifier": "private static final",
"original_string": "private static final ISOChronology UTC_CHRONOLOGY = ISOChronology.getInstanceUTC();",
"type": "ISOChronology",
"var_name": "UTC_CHRONOLOGY"
},
... | {
"body": "@Test\n public void testMaxShardRows()\n {\n OrcStorageManager manager = createOrcStorageManager(2, DataSize.of(2, MEGABYTE));\n\n List<Long> columnIds = ImmutableList.of(3L, 7L);\n List<Type> columnTypes = ImmutableList.of(BIGINT, createVarcharType(10));\n\n StoragePageSi... | {
"fields": [
{
"declarator": "SHARD_DELTA_CODEC = jsonCodec(ShardDelta.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ShardDelta> SHARD_DELTA_CODEC = jsonCodec(ShardDelta.class);",
"type": "JsonCodec<ShardDelta>",
"var_name": "SHARD_D... | {
"body": "@Override\n public StoragePageSink createStoragePageSink(long transactionId, OptionalInt bucketNumber, List<Long> columnIds, List<Type> columnTypes, boolean checkSpace)\n {\n if (checkSpace && storageService.getAvailableBytes() < minAvailableSpace.toBytes()) {\n throw new PrestoExce... | {
"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_601 | {
"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 testBuildQuery()\n {\n TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(\n COL1, Domain.create(ValueSet.ofRanges(range(BIGINT, 100L, false, 200L, true)), false),\n COL2, Domain.singleValue(createUnboundedVar... | {
"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_18 | {
"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 testSchemaRulesForCheckCanCreateSchema()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-schema.json\");\n\n accessControl.checkCanCreateSchema(ADMIN, new CatalogSchemaName(\"some-catalog\", \"bob\"));\n acc... | {
"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 checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema)\n {\n if (!isSchemaOwner(context, schema)) {\n denyCreateSchema(schema.toString());\n }\n }",
"class_method_signature": "FileBasedSystemAccessControl.checkCanCreateSchem... | {
"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_1274 | {
"fields": [],
"file": "presto-parquet/src/test/java/io/prestosql/parquet/predicate/TestPredicateUtils.java",
"identifier": "TestPredicateUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings(\"deprecation\")\n public void testDictionaryEncodingV2()\n {\n assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(RLE_DICTIONARY)));\n assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(PLAIN_DICTIONARY)));\n assertFalse(isO... | {
"fields": [],
"file": "presto-parquet/src/main/java/io/prestosql/parquet/predicate/PredicateUtils.java",
"identifier": "PredicateUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PredicateUtils.PredicateUtils()",
"constructor": true,
"full_signature": "private Predic... | {
"body": "@VisibleForTesting\n @SuppressWarnings(\"deprecation\")\n static boolean isOnlyDictionaryEncodingPages(ColumnChunkMetaData columnMetaData)\n {\n // Files written with newer versions of Parquet libraries (e.g. parquet-mr 1.9.0) will have EncodingStats available\n // Otherwise, fallbac... | {
"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_494 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestDomain.java",
"identifier": "TestDomain",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnion()\n {\n assertUnion(Domain.all(BIGINT), Domain.all(BIGINT), Domain.all(BIGINT));\n assertUnion(Domain.none(BIGINT), Domain.none(BIGINT), Domain.none(BIGINT));\n assertUnion(Domain.all(BIGINT), Domain.none(BIGINT), Domain.all(BIGINT));\n assert... | {
"fields": [
{
"declarator": "DEFAULT_COMPACTION_THRESHOLD = 32",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_COMPACTION_THRESHOLD = 32;",
"type": "int",
"var_name": "DEFAULT_COMPACTION_THRESHOLD"
},
{
"declarator": "values",
... | {
"body": "public Domain union(Domain other)\n {\n checkCompatibility(other);\n return new Domain(values.union(other.getValues()), this.isNullAllowed() || other.isNullAllowed());\n }",
"class_method_signature": "Domain.union(Domain other)",
"constructor": false,
"full_signature": "public Dom... | {
"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_181 | {
"fields": [
{
"declarator": "codec = JsonCodec.jsonCodec(HiveTableHandle.class)",
"modifier": "private final",
"original_string": "private final JsonCodec<HiveTableHandle> codec = JsonCodec.jsonCodec(HiveTableHandle.class);",
"type": "JsonCodec<HiveTableHandle>",
"var_name": "codec... | {
"body": "@Test\n public void testRoundTrip()\n {\n HiveTableHandle expected = new HiveTableHandle(\"schema\", \"table\", ImmutableMap.of(), ImmutableList.of(), Optional.empty());\n\n String json = codec.toJson(expected);\n HiveTableHandle actual = codec.fromJson(json);\n\n assertEq... | {
"fields": [
{
"declarator": "schemaName",
"modifier": "private final",
"original_string": "private final String schemaName;",
"type": "String",
"var_name": "schemaName"
},
{
"declarator": "tableName",
"modifier": "private final",
"original_string": "privat... | {
"body": "public SchemaTableName getSchemaTableName()\n {\n return new SchemaTableName(schemaName, tableName);\n }",
"class_method_signature": "HiveTableHandle.getSchemaTableName()",
"constructor": false,
"full_signature": "public SchemaTableName getSchemaTableName()",
"identifier": "getSchemaTa... | {
"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_928 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java",
"identifier": "TestLogicalPlanner",
"interfaces": "",
"superclass": "extends BasePlanTest"
} | {
"body": "@Test\n public void testReferenceToSameFieldAppliedOnlyOnce()\n {\n assertEquals(\n countOfMatchingNodes(\n plan(\n \"SELECT \" +\n \"(SELECT 1 FROM orders WHERE orderkey = x) + \" +\n ... | {
"fields": [
{
"declarator": "idAllocator",
"modifier": "private final",
"original_string": "private final PlanNodeIdAllocator idAllocator;",
"type": "PlanNodeIdAllocator",
"var_name": "idAllocator"
},
{
"declarator": "session",
"modifier": "private final",
... | {
"body": "public Plan plan(Analysis analysis)\n {\n return plan(analysis, OPTIMIZED_AND_VALIDATED);\n }",
"class_method_signature": "LogicalPlanner.plan(Analysis analysis)",
"constructor": false,
"full_signature": "public Plan plan(Analysis analysis)",
"identifier": "plan",
"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_882 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testFromUtf8()\n {\n assertFunction(\"from_utf8(to_utf8('hello'))\", VARCHAR, \"hello\");\n assertFunction(\"from_utf8(from_hex('58BF'))\", VARCHAR, \"X\\uFFFD\");\n assertFunction(\"from_utf8(from_hex('58DF'))\", VARCHAR, \"X\\uFFFD\");\n assertFunctio... | {
"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(\"Decodes the UTF-8 encoded string\")\n @ScalarFunction\n @SqlType(StandardTypes.VARCHAR)\n public static Slice fromUtf8(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n return SliceUtf8.fixInvalidUtf8(slice);\n }",
"class_method_signature": "StringFunctions.fromUtf... | {
"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_752 | {
"fields": [
{
"declarator": "scheduler",
"modifier": "private",
"original_string": "private ScheduledExecutorService scheduler;",
"type": "ScheduledExecutorService",
"var_name": "scheduler"
},
{
"declarator": "pageBufferClientCallbackExecutor",
"modifier": "priv... | {
"body": "@Test\n public void testExceptionFromResponseHandler()\n throws Exception\n {\n TestingTicker ticker = new TestingTicker();\n AtomicReference<Duration> tickerIncrement = new AtomicReference<>(new Duration(0, TimeUnit.SECONDS));\n\n TestingHttpClient.Processor processor... | {
"fields": [
{
"declarator": "log = Logger.get(HttpPageBufferClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(HttpPageBufferClient.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "self... | {
"body": "public synchronized void scheduleRequest()\n {\n if (closed || (future != null) || scheduled) {\n return;\n }\n scheduled = true;\n\n // start before scheduling to include error delay\n backoff.startRequest();\n\n long delayNanos = backoff.getBackoffD... | {
"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_302 | {
"fields": [
{
"declarator": "RUNTIME_OBJECT = \"java.lang:type=Runtime\"",
"modifier": "private static final",
"original_string": "private static final String RUNTIME_OBJECT = \"java.lang:type=Runtime\";",
"type": "String",
"var_name": "RUNTIME_OBJECT"
},
{
"declarato... | {
"body": "@Test\n public void testListSchemas()\n {\n assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of(JMX_SCHEMA_NAME, HISTORY_SCHEMA_NAME));\n }",
"class_method_signature": "TestJmxMetadata.testListSchemas()",
"constructor": false,
"full_signature": "@Test public void testList... | {
"fields": [
{
"declarator": "LOGGER = Logger.get(JmxMetadata.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.get(JmxMetadata.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JMX_SCHEMA_NA... | {
"body": "@Override\n public List<String> listSchemaNames(ConnectorSession session)\n {\n return ImmutableList.of(JMX_SCHEMA_NAME, HISTORY_SCHEMA_NAME);\n }",
"class_method_signature": "JmxMetadata.listSchemaNames(ConnectorSession session)",
"constructor": false,
"full_signature": "@Override pu... | {
"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_1018 | {
"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 testNonDeterministicOrderBy()\n {\n analyze(\"SELECT DISTINCT random() as b FROM t1 ORDER BY b\");\n analyze(\"SELECT random() FROM t1 ORDER BY random()\");\n analyze(\"SELECT a FROM t1 ORDER BY random()\");\n assertFails(\"SELECT DISTINCT random() FROM... | {
"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_617 | {
"fields": [
{
"declarator": "lowMemoryKiller = new TotalReservationOnBlockedNodesLowMemoryKiller()",
"modifier": "private final",
"original_string": "private final LowMemoryKiller lowMemoryKiller = new TotalReservationOnBlockedNodesLowMemoryKiller();",
"type": "LowMemoryKiller",
"v... | {
"body": "@Test\n public void testSkewedQuery()\n {\n int reservePool = 10;\n int generalPool = 12;\n // q1 is neither the query with the most total memory reservation, nor the query with the max memory reservation.\n // This also tests the corner case where a node doesn't have a ge... | {
"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_247 | {
"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 testUncompressedSize()\n throws Exception\n {\n List<Long> columnIds = ImmutableList.of(1L, 2L, 3L, 4L, 5L);\n List<Type> columnTypes = ImmutableList.of(BOOLEAN, BIGINT, DOUBLE, createVarcharType(10), VARBINARY);\n\n File file = new File(temporary, ... | {
"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": "private static int uncompressedSize(Object object)\n throws IOException\n {\n if (object instanceof OrcStruct) {\n OrcStruct struct = (OrcStruct) object;\n int size = 0;\n for (int i = 0; i < struct.getNumFields(); i++) {\n size += uncomp... | {
"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_569 | {
"fields": [
{
"declarator": "database",
"modifier": "private",
"original_string": "private TestingDatabase database;",
"type": "TestingDatabase",
"var_name": "database"
},
{
"declarator": "jdbcClient",
"modifier": "private",
"original_string": "private Jdb... | {
"body": "@Test\n public void testGetRecordSet()\n {\n ConnectorTransactionHandle transaction = new JdbcTransactionHandle();\n JdbcRecordSetProvider recordSetProvider = new JdbcRecordSetProvider(jdbcClient);\n RecordSet recordSet = recordSetProvider.getRecordSet(transaction, SESSION, split... | {
"fields": [
{
"declarator": "jdbcClient",
"modifier": "private final",
"original_string": "private final JdbcClient jdbcClient;",
"type": "JdbcClient",
"var_name": "jdbcClient"
}
],
"file": "presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/JdbcRecordSetProvider.java"... | {
"body": "@Override\n public RecordSet getRecordSet(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorSplit split, ConnectorTableHandle table, List<? extends ColumnHandle> columns)\n {\n JdbcSplit jdbcSplit = (JdbcSplit) split;\n JdbcTableHandle jdbcTable = (JdbcTableHand... | {
"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_139 | {
"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 testCreateDataColumnStatistics()\n {\n assertEquals(createDataColumnStatistics(COLUMN, BIGINT, 1000, ImmutableList.of()), ColumnStatistics.empty());\n assertEquals(\n createDataColumnStatistics(COLUMN, BIGINT, 1000, ImmutableList.of(PartitionStatistics... | {
"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 ColumnStatistics createDataColumnStatistics(String column, Type type, double rowsCount, Collection<PartitionStatistics> partitionStatistics)\n {\n List<HiveColumnStatistics> columnStatistics = partitionStatistics.stream()\n .map(PartitionStatistics::g... | {
"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_990 | {
"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 testValues()\n {\n TypeProvider types = TypeProvider.copyOf(ImmutableMap.<Symbol, Type>builder()\n .put(A, BIGINT)\n .put(B, BIGINT)\n .put(D, DOUBLE)\n .build());\n\n // one column\n assertEquals(\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_1223 | {
"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 testBalancedSplitAssignment()\n {\n // use private node manager so we can add a node later\n InMemoryNodeManager nodeManager = new InMemoryNodeManager();\n nodeManager.addNode(CONNECTOR_ID,\n new InternalNode(\"other1\", URI.create(\"http://127.... | {
"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_586 | {
"fields": [
{
"declarator": "database",
"modifier": "private",
"original_string": "private TestingDatabase database;",
"type": "TestingDatabase",
"var_name": "database"
},
{
"declarator": "jdbcClient",
"modifier": "private",
"original_string": "private Jdb... | {
"body": "@Test\n public void testGetColumnTypes()\n {\n RecordSet recordSet = createRecordSet(ImmutableList.of(\n new JdbcColumnHandle(\"text\", JDBC_VARCHAR, VARCHAR),\n new JdbcColumnHandle(\"text_short\", JDBC_VARCHAR, createVarcharType(32)),\n new JdbcCo... | {
"fields": [
{
"declarator": "jdbcClient",
"modifier": "private final",
"original_string": "private final JdbcClient jdbcClient;",
"type": "JdbcClient",
"var_name": "jdbcClient"
},
{
"declarator": "table",
"modifier": "private final",
"original_string": "pr... | {
"body": "@Override\n public List<Type> getColumnTypes()\n {\n return columnTypes;\n }",
"class_method_signature": "JdbcRecordSet.getColumnTypes()",
"constructor": false,
"full_signature": "@Override public List<Type> getColumnTypes()",
"identifier": "getColumnTypes",
"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_355 | {
"fields": [
{
"declarator": "ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\")",
"modifier": "private static final",
"original_string": "private static final DateTimeZone ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\");",
"type": "DateTimeZone",
"var_name": "ASIA_ORAL_ZONE"
... | {
"body": "@Test\n public void testResultSetClose()\n throws Exception\n {\n try (Connection connection = createConnection()) {\n try (Statement statement = connection.createStatement()) {\n assertTrue(statement.execute(\"SELECT 123 x, 'foo' y\"));\n Re... | {
"fields": [
{
"declarator": "DRIVER_NAME = \"Presto JDBC Driver\"",
"modifier": "static final",
"original_string": "static final String DRIVER_NAME = \"Presto JDBC Driver\";",
"type": "String",
"var_name": "DRIVER_NAME"
},
{
"declarator": "DRIVER_VERSION",
"modi... | {
"body": "@Override\n public void close()\n {\n httpClient.dispatcher().executorService().shutdown();\n httpClient.connectionPool().evictAll();\n }",
"class_method_signature": "PrestoDriver.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier":... | {
"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_705 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/security/TestForwardingAccessControl.java",
"identifier": "TestForwardingAccessControl",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProperForwardingMethodsAreCalled()\n {\n assertProperForwardingMethodsAreCalled(AccessControl.class, accessControl -> ForwardingAccessControl.of(() -> accessControl));\n }",
"class_method_signature": "TestForwardingAccessControl.testProperForwardingMethodsAreCalled... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/security/ForwardingAccessControl.java",
"identifier": "ForwardingAccessControl",
"interfaces": "implements AccessControl",
"methods": [
{
"class_method_signature": "ForwardingAccessControl.of(Supplier<AccessControl> accessControlSupplie... | {
"body": "public static ForwardingAccessControl of(Supplier<AccessControl> accessControlSupplier)\n {\n requireNonNull(accessControlSupplier, \"accessControlSupplier is null\");\n return new ForwardingAccessControl()\n {\n @Override\n protected AccessControl delegate()\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_210 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/TestRaptorBucketFunction.java",
"identifier": "TestRaptorBucketFunction",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVarcharBigint()\n {\n BucketFunction function = bucketFunction(50, createUnboundedVarcharType(), BIGINT);\n assertEquals(getBucket(function, createStringsBlock(\"lorem ipsum\"), createLongsBlock(123456789012L)), 24);\n assertEquals(getBucket(function, crea... | {
"fields": [
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final HashFunction[] functions;",
"type": "HashFunction[]",
"var_name": "functions"
},
{
"declarator": "bucketCount",
"modifier": "private final",
"original_s... | {
"body": "@SuppressWarnings(\"NumericCastThatLosesPrecision\")\n @Override\n public int getBucket(Page page, int position)\n {\n long hash = 0;\n for (int i = 0; i < page.getChannelCount(); i++) {\n Block block = page.getBlock(i);\n long value = functions[i].hash(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_640 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestDoubleOperators.java",
"identifier": "TestDoubleOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testModulus()\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(MODULUS)\n @SqlType(StandardTypes.DOUBLE)\n public static double modulus(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right)\n {\n return left % right;\n }",
"class_method_signature": "DoubleOperators.modulus(@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_904 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGroupedTuple()\n {\n List<LocalProperty<String>> actual = builder()\n .grouped(\"a\", \"b\", \"c\")\n .build();\n\n assertMatch(\n actual,\n builder().grouped(\"a\", \"b\", \"c\", \"d\").build(),\n ... | {
"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_457 | {
"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 testIsNegative()\n {\n assertEquals(isNegative(MIN_DECIMAL), true);\n assertEquals(isNegative(MAX_DECIMAL), false);\n assertEquals(isNegative(unscaledDecimal(0)), false);\n }",
"class_method_signature": "TestUnscaledDecimal128Arithmetic.testIsNegative()",... | {
"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": "private static boolean isNegative(int lastRawHigh)\n {\n return lastRawHigh >>> 31 != 0;\n }",
"class_method_signature": "UnscaledDecimal128Arithmetic.isNegative(int lastRawHigh)",
"constructor": false,
"full_signature": "private static boolean isNegative(int lastRawHigh)",
"identifier... | {
"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_512 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestClientOptions.java",
"identifier": "TestClientOptions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testServerHostOnly()\n {\n Console console = createConsole(\"--server=test\");\n ClientSession session = console.clientOptions.toClientSession();\n assertEquals(session.getServer().toString(), \"http://test:80\");\n }",
"class_method_signature": "TestClie... | {
"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_142 | {
"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 testCalculateDataSize()\n {\n assertEquals(calculateDataSize(COLUMN, ImmutableList.of(), 0), Estimate.unknown());\n assertEquals(calculateDataSize(COLUMN, ImmutableList.of(), 1000), Estimate.unknown());\n assertEquals(calculateDataSize(COLUMN, ImmutableList.of... | {
"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 calculateDataSize(String column, Collection<PartitionStatistics> partitionStatistics, double totalRowCount)\n {\n List<PartitionStatistics> statisticsWithKnownRowCountAndDataSize = partitionStatistics.stream()\n .filter(statistics -> {\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_1258 | {
"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 testInstantNanos()\n {\n assertThat(getDomain(TIMESTAMP_TZ_NANOS, 0, null))\n .isEqualTo(none(TIMESTAMP_TZ_NANOS));\n assertThat(getDomain(TIMESTAMP_TZ_NANOS, 10, null))\n .isEqualTo(all(TIMESTAMP_TZ_NANOS));\n\n assertThat(getDom... | {
"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_841 | {
"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 testFromBase()\n {\n assertFunction(\"from_base('80000000', 16)\", BIGINT, 2147483648L);\n assertFunction(\"from_base('11111111', 2)\", BIGINT, 255L);\n assertFunction(\"from_base('-7fffffff', 16)\", BIGINT, -2147483647L);\n assertFunction(\"from_base('... | {
"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(\"Convert a string in the given base to a number\")\n @ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.BIGINT)\n public static long fromBase(@SqlType(\"varchar(x)\") Slice value, @SqlType(StandardTypes.BIGINT) long radix)\n {\n checkRadix(radix);\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_34 | {
"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 testTableRulesForCheckCanShowCreateTable()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanShowCreateTable(ADMIN, new CatalogSchemaTableName(\"some-catalog\", \"bobschema\",... | {
"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 checkCanShowCreateTable(SystemSecurityContext context, CatalogSchemaTableName table)\n {\n if (!checkTablePermission(context, table, OWNERSHIP)) {\n denyShowCreateTable(table.toString());\n }\n }",
"class_method_signature": "FileBasedSystemAccessC... | {
"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_791 | {
"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 testToBigEndian64()\n {\n assertFunction(\"to_big_endian_64(0)\", VARBINARY, sqlVarbinaryFromHex(\"0000000000000000\"));\n assertFunction(\"to_big_endian_64(1)\", VARBINARY, sqlVarbinaryFromHex(\"0000000000000001\"));\n assertFunction(\"to_big_endian_64(922337... | {
"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 64-bit 2's complement big endian varbinary\")\n @ScalarFunction(\"to_big_endian_64\")\n @SqlType(StandardTypes.VARBINARY)\n public static Slice toBigEndian64(@SqlType(StandardTypes.BIGINT) long value)\n {\n Slice slice = Slices.allocate(Long.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_1171 | {
"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 testNonTransactionalClient()\n {\n Session session = sessionBuilder().build();\n TransactionManager transactionManager = createTestTransactionManager();\n QueryStateMachine stateMachine = createQueryStateMachine(\"START TRANSACTION\", session, transactionManag... | {
"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_1034 | {
"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 testHaving()\n {\n // TODO: verify output\n analyze(\"SELECT sum(a) FROM t1 HAVING avg(a) - avg(b) > 10\");\n\n assertFails(\"SELECT a FROM t1 HAVING a = 1\")\n .hasErrorCode(EXPRESSION_NOT_AGGREGATE)\n .hasMessageMatching(\"line ... | {
"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_284 | {
"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 testReadBlock()\n {\n PrestoThriftBlock columnsData = longColumn(\n new boolean[] {false, true, false, false, false, false, true},\n new long[] {2, 0, 1, 3, 8, 4, 0});\n Block actual = columnsData.toBlock(BIGINT);\n assertBlockEqu... | {
"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_400 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTDifference()\n {\n assertFunction(\"ST_AsText(ST_Difference(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)')))\", VARCHAR, \"POINT (50 100)\");\n assertFunction(\"ST_AsText(ST_Difference(ST_GeometryFromText('MULTIPOINT (50 100, 50 2... | {
"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 Geometry value that represents the point set difference of two geometries\")\n @ScalarFunction(\"ST_Difference\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stDifference(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right)\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_953 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestRemoveUnreferencedScalarApplyNodes.java",
"identifier": "TestRemoveUnreferencedScalarApplyNodes",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testEmptyAssignments()\n {\n tester().assertThat(new RemoveUnreferencedScalarApplyNodes())\n .on(p -> p.apply(\n Assignments.of(),\n ImmutableList.of(),\n p.values(p.symbol(\"x\")),\n ... | {
"fields": [
{
"declarator": "PATTERN = applyNode()\n .matching(applyNode -> applyNode.getSubqueryAssignments().isEmpty())",
"modifier": "private static final",
"original_string": "private static final Pattern<ApplyNode> PATTERN = applyNode()\n .matching(applyNode -> apply... | {
"body": "@Override\n public Result apply(ApplyNode applyNode, Captures captures, Context context)\n {\n return Result.ofPlanNode(applyNode.getInput());\n }",
"class_method_signature": "RemoveUnreferencedScalarApplyNodes.apply(ApplyNode applyNode, Captures captures, Context context)",
"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_816 | {
"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 testDegrees()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(format(\"degrees(%s)\", doubleValue), DOUBLE, Math.toDegrees(doubleValue));\n assertFunction(format(\"degrees(REAL '%s')\", (float) doubleValue), DOUBLE, Math.toDegrees((fl... | {
"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(\"Converts an angle in radians to degrees\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double degrees(@SqlType(StandardTypes.DOUBLE) double radians)\n {\n return Math.toDegrees(radians);\n }",
"class_method_signature": "MathFunctions.degrees(@Sq... | {
"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_63 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBuildGlueExpressionDomainEqualsSingleValue()\n {\n Domain domain = Domain.singleValue(VarcharType.VARCHAR, utf8Slice(\"2020-01-01\"));\n Optional<String> foo = buildGlueExpressionForSingleDomain(\"foo\", domain, true);\n assertEquals(foo.get(), \"((foo = '... | {
"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": "@VisibleForTesting\n static Optional<String> buildGlueExpressionForSingleDomain(String columnName, Domain domain, boolean assumeCanonicalPartitionKeys)\n {\n ValueSet valueSet = domain.getValues();\n\n if (domain.isAll() || !canConvertSqlTypeToStringForGlue(domain.getType(), assumeCanon... | {
"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_115 | {
"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 testListRoles()\n {\n assertEquals(mockClient.getAccessCount(), 0);\n\n assertEquals(metastore.listRoles(), TEST_ROLES);\n assertEquals(mockClient.getAccessCount(), 1);\n\n assertEquals(metastore.listRoles(), TEST_ROLES);\n assertEquals(mockClien... | {
"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 Set<String> listRoles()\n {\n return get(rolesCache, \"\");\n }",
"class_method_signature": "CachingHiveMetastore.listRoles()",
"constructor": false,
"full_signature": "@Override public Set<String> listRoles()",
"identifier": "listRoles",
"invocations": [
"g... | {
"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_545 | {
"fields": [
{
"declarator": "EMPTY_RESOURCE_ESTIMATES = new ResourceEstimates(Optional.empty(), Optional.empty(), Optional.empty())",
"modifier": "private static final",
"original_string": "private static final ResourceEstimates EMPTY_RESOURCE_ESTIMATES = new ResourceEstimates(Optional.empty()... | {
"body": "@Test\n public void testLegacyConfiguration()\n {\n FileResourceGroupConfigurationManager manager = parse(\"resource_groups_config_legacy.json\");\n ResourceGroupId globalId = new ResourceGroupId(\"global\");\n ResourceGroup global = new TestingResourceGroup(globalId);\n m... | {
"fields": [
{
"declarator": "CODEC = new JsonCodecFactory(\n () -> new ObjectMapperProvider().get().enable(FAIL_ON_UNKNOWN_PROPERTIES))\n .jsonCodec(ManagerSpec.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ManagerSpec> CO... | {
"body": "@Override\n public void configure(ResourceGroup group, SelectionContext<ResourceGroupIdTemplate> context)\n {\n configureGroup(group, getMatchingSpec(group, context));\n }",
"class_method_signature": "FileResourceGroupConfigurationManager.configure(ResourceGroup group, SelectionContext<Re... | {
"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_1126 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/TestQueryStateInfo.java",
"identifier": "TestQueryStateInfo",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testQueryStateInfo()\n {\n InternalResourceGroup root = new InternalResourceGroup(\"root\", (group, export) -> {}, directExecutor());\n root.setSoftMemoryLimitBytes(DataSize.of(1, MEGABYTE).toBytes());\n root.setMaxQueuedQueries(40);\n root.setHardConcu... | {
"fields": [
{
"declarator": "queryState",
"modifier": "private final",
"original_string": "private final QueryState queryState;",
"type": "QueryState",
"var_name": "queryState"
},
{
"declarator": "queryId",
"modifier": "private final",
"original_string": "... | {
"body": "@JsonCreator\n public QueryStateInfo(\n @JsonProperty(\"queryId\") QueryId queryId,\n @JsonProperty(\"queryState\") QueryState queryState,\n @JsonProperty(\"resourceGroupId\") Optional<ResourceGroupId> resourceGroupId,\n @JsonProperty(\"query\") String query,\... | {
"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_396 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTPoints()\n {\n assertFunction(\"ST_Points(ST_GeometryFromText('LINESTRING EMPTY'))\", new ArrayType(GEOMETRY), null);\n assertSTPoints(\"LINESTRING (0 0, 0 0)\", \"0 0\", \"0 0\");\n assertSTPoints(\"LINESTRING (8 4, 3 9, 8 4)\", \"8 4\", \"3 9\", \"8 4\... | {
"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 an array of points in a geometry\")\n @ScalarFunction(\"ST_Points\")\n @SqlType(\"array(\" + GEOMETRY_TYPE_NAME + \")\")\n public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n Geometry geometry = JtsGeometrySerde.deserializ... | {
"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_729 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/window/TestLagFunction.java",
"identifier": "TestLagFunction",
"interfaces": "",
"superclass": "extends AbstractTestWindowFunction"
} | {
"body": "@Test\n public void testLagFunction()\n {\n assertWindowQuery(\"lag(orderdate) OVER (PARTITION BY orderstatus ORDER BY orderkey)\",\n resultBuilder(TEST_SESSION, INTEGER, VARCHAR, VARCHAR)\n .row(3, \"F\", null)\n .row(5, \"F\", \"19... | {
"fields": [
{
"declarator": "valueChannel",
"modifier": "private final",
"original_string": "private final int valueChannel;",
"type": "int",
"var_name": "valueChannel"
},
{
"declarator": "offsetChannel",
"modifier": "private final",
"original_string": "pr... | {
"body": "public LagFunction(List<Integer> argumentChannels, boolean ignoreNulls)\n {\n this.valueChannel = argumentChannels.get(0);\n this.offsetChannel = (argumentChannels.size() > 1) ? argumentChannels.get(1) : -1;\n this.defaultChannel = (argumentChannels.size() > 2) ? argumentChannels.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.