id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
166515022_1184 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testForceFreeMemory()\n {\n PartitionedOutputBuffer buffer = createPartitionedBuffer(\n createInitialEmptyOutputBuffers(PARTITIONED)\n .withBuffer(FIRST, 0)\n .withNoMoreBufferIds(),\n sizeOfPages(1... | {
"fields": [
{
"declarator": "state",
"modifier": "private final",
"original_string": "private final StateMachine<BufferState> state;",
"type": "StateMachine<BufferState>",
"var_name": "state"
},
{
"declarator": "outputBuffers",
"modifier": "private final",
... | {
"body": "@VisibleForTesting\n void forceFreeMemory()\n {\n memoryManager.close();\n }",
"class_method_signature": "PartitionedOutputBuffer.forceFreeMemory()",
"constructor": false,
"full_signature": "@VisibleForTesting void forceFreeMemory()",
"identifier": "forceFreeMemory",
"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_334 | {
"fields": [],
"file": "presto-jdbc/src/test/java/io/prestosql/jdbc/TestPrestoDriverUri.java",
"identifier": "TestPrestoDriverUri",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUriWithClientTags()\n throws SQLException\n {\n String clientTags = \"c1,c2\";\n PrestoDriverUri parameters = createDriverUri(\"presto://localhost:8080?clientTags=\" + clientTags);\n Properties properties = parameters.getProperties();\n a... | {
"fields": [
{
"declarator": "JDBC_URL_START = \"jdbc:\"",
"modifier": "private static final",
"original_string": "private static final String JDBC_URL_START = \"jdbc:\";",
"type": "String",
"var_name": "JDBC_URL_START"
},
{
"declarator": "QUERY_SPLITTER = Splitter.on(... | {
"body": "public Properties getProperties()\n {\n return properties;\n }",
"class_method_signature": "PrestoDriverUri.getProperties()",
"constructor": false,
"full_signature": "public Properties getProperties()",
"identifier": "getProperties",
"invocations": [],
"modifiers": "public",
"par... | {
"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_764 | {
"fields": [
{
"declarator": "executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass()... | {
"body": "@Test\n public void testFilterNoColumns()\n {\n PageProcessor pageProcessor = new PageProcessor(Optional.of(new TestingPageFilter(positionsRange(0, 50))), ImmutableList.of());\n\n Page inputPage = new Page(createLongSequenceBlock(0, 100));\n\n LocalMemoryContext memoryContext = n... | {
"fields": [
{
"declarator": "MAX_BATCH_SIZE = 8 * 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_BATCH_SIZE = 8 * 1024;",
"type": "int",
"var_name": "MAX_BATCH_SIZE"
},
{
"declarator": "MAX_PAGE_SIZE_IN_BYTES = 4 * 1024 * 102... | {
"body": "public Iterator<Optional<Page>> process(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page)\n {\n return process(session, yieldSignal, memoryContext, page, false);\n }",
"class_method_signature": "PageProcessor.process(ConnectorSession sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_5 | {
"fields": [],
"file": "presto-client/src/test/java/io/prestosql/client/TestFixJsonDataUtils.java",
"identifier": "TestFixJsonDataUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFixData()\n {\n assertQueryResult(BIGINT.getTypeSignature(), 1000, 1000L);\n assertQueryResult(INTEGER.getTypeSignature(), 100, 100);\n assertQueryResult(SMALLINT.getTypeSignature(), 10, (short) 10);\n assertQueryResult(TINYINT.getTypeSignature(), 1... | {
"fields": [],
"file": "presto-client/src/main/java/io/prestosql/client/FixJsonDataUtils.java",
"identifier": "FixJsonDataUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "FixJsonDataUtils.FixJsonDataUtils()",
"constructor": true,
"full_signature": "private FixJsonDat... | {
"body": "public static Iterable<List<Object>> fixData(List<Column> columns, Iterable<List<Object>> data)\n {\n if (data == null) {\n return null;\n }\n requireNonNull(columns, \"columns is null\");\n List<ClientTypeSignature> signatures = columns.stream()\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_508 | {
"fields": [
{
"declarator": "BLOCK_BUILDER_INSTANCE_SIZE = parseClass(VariableWidthBlockBuilder.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final int BLOCK_BUILDER_INSTANCE_SIZE = parseClass(VariableWidthBlockBuilder.class).instanceSize();",
... | {
"body": "@Test\n public void testNewBlockBuilderLike()\n {\n int entries = 12345;\n double resetSkew = 1.25;\n BlockBuilder blockBuilder = new VariableWidthBlockBuilder(null, entries, entries);\n for (int i = 0; i < entries; i++) {\n blockBuilder.writeByte(i);\n ... | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(VariableWidthBlockBuilder.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final int INSTANCE_SIZE = ClassLayout.parseClass(VariableWidthBlockBuilder.class).instanceSize();",
... | {
"body": "@Override\n public BlockBuilder newBlockBuilderLike(BlockBuilderStatus blockBuilderStatus)\n {\n int currentSizeInBytes = positions == 0 ? positions : (getOffset(positions) - getOffset(0));\n return new VariableWidthBlockBuilder(blockBuilderStatus, calculateBlockResetSize(positions), ca... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_158 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestStatistics.java",
"identifier": "TestStatistics",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReduce()\n {\n assertThat(reduce(createEmptyStatistics(), createEmptyStatistics(), ADD)).isEqualTo(createEmptyStatistics());\n assertThat(reduce(createZeroStatistics(), createEmptyStatistics(), ADD)).isEqualTo(createEmptyStatistics());\n assertThat(reduce(... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/util/Statistics.java",
"identifier": "Statistics",
"interfaces": "",
"methods": [
{
"class_method_signature": "Statistics.Statistics()",
"constructor": true,
"full_signature": "private Statistics()",
"iden... | {
"body": "public static HiveBasicStatistics reduce(HiveBasicStatistics first, HiveBasicStatistics second, ReduceOperator operator)\n {\n return new HiveBasicStatistics(\n reduce(first.getFileCount(), second.getFileCount(), operator, false),\n reduce(first.getRowCount(), second... | {
"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_1242 | {
"fields": [],
"file": "presto-orc/src/test/java/io/prestosql/orc/TestOrcDataSourceUtils.java",
"identifier": "TestOrcDataSourceUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeGap()\n {\n List<DiskRange> consistent10ByteGap = ImmutableList.of(new DiskRange(100, 90), new DiskRange(200, 90), new DiskRange(300, 90));\n assertEquals(mergeAdjacentDiskRanges(consistent10ByteGap, DataSize.ofBytes(0), DataSize.of(1, GIGABYTE)), consistent... | {
"fields": [],
"file": "presto-orc/src/main/java/io/prestosql/orc/OrcDataSourceUtils.java",
"identifier": "OrcDataSourceUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrcDataSourceUtils.OrcDataSourceUtils()",
"constructor": true,
"full_signature": "private OrcDataS... | {
"body": "public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize)\n {\n // sort ranges by start offset\n List<DiskRange> ranges = new ArrayList<>(diskRanges);\n ranges.sort(comparingLong(DiskRange::getOffset));\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_4 | {
"fields": [],
"file": "presto-client/src/test/java/io/prestosql/client/TestIntervalYearMonth.java",
"identifier": "TestIntervalYearMonth",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testOverflow()\n {\n int days = (Integer.MAX_VALUE / 12) + 1;\n toMonths(days, 0);\n }",
"class_method_signature": "TestIntervalYearMonth.testOverflow()",
"constructor": false,
"full_signature": "@Test(exp... | {
"fields": [
{
"declarator": "INT_MIN_VALUE = \"-178956970-8\"",
"modifier": "private static final",
"original_string": "private static final String INT_MIN_VALUE = \"-178956970-8\";",
"type": "String",
"var_name": "INT_MIN_VALUE"
},
{
"declarator": "FORMAT = Pattern.c... | {
"body": "public static int toMonths(int year, int months)\n {\n try {\n return addExact(multiplyExact(year, 12), months);\n }\n catch (ArithmeticException e) {\n throw new IllegalArgumentException(e);\n }\n }",
"class_method_signature": "IntervalYearMonth.to... | {
"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_509 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestClientOptions.java",
"identifier": "TestClientOptions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n Console console = createConsole();\n ClientOptions options = console.clientOptions;\n assertEquals(options.krb5ServicePrincipalPattern, \"${SERVICE}@${HOST}\");\n ClientSession session = options.toClientSession();\n assertEqu... | {
"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_159 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestStatistics.java",
"identifier": "TestStatistics",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeHiveColumnStatisticsMap()\n {\n Map<String, HiveColumnStatistics> first = ImmutableMap.of(\n \"column1\", createIntegerColumnStatistics(OptionalLong.of(1), OptionalLong.of(2), OptionalLong.of(3), OptionalLong.of(4)),\n \"column2\", Hiv... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/util/Statistics.java",
"identifier": "Statistics",
"interfaces": "",
"methods": [
{
"class_method_signature": "Statistics.Statistics()",
"constructor": true,
"full_signature": "private Statistics()",
"iden... | {
"body": "public static PartitionStatistics merge(PartitionStatistics first, PartitionStatistics second)\n {\n if (first.getBasicStatistics().getRowCount().isPresent() && first.getBasicStatistics().getRowCount().getAsLong() == 0) {\n return second;\n }\n if (second.getBasicStatisti... | {
"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_1243 | {
"fields": [],
"file": "presto-orc/src/test/java/io/prestosql/orc/TestOrcDataSourceUtils.java",
"identifier": "TestOrcDataSourceUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeMaxSize()\n {\n List<DiskRange> consistent10ByteGap = ImmutableList.of(new DiskRange(100, 90), new DiskRange(200, 90), new DiskRange(300, 90));\n assertEquals(mergeAdjacentDiskRanges(consistent10ByteGap, DataSize.ofBytes(10), DataSize.ofBytes(0)), consistent... | {
"fields": [],
"file": "presto-orc/src/main/java/io/prestosql/orc/OrcDataSourceUtils.java",
"identifier": "OrcDataSourceUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrcDataSourceUtils.OrcDataSourceUtils()",
"constructor": true,
"full_signature": "private OrcDataS... | {
"body": "public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize)\n {\n // sort ranges by start offset\n List<DiskRange> ranges = new ArrayList<>(diskRanges);\n ranges.sort(comparingLong(DiskRange::getOffset));\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_270 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testSimpleTemporal()\n {\n List<Type> temporalType = ImmutableList.of(DATE);\n List<Type> types = ImmutableList.of(BIGINT);\n\n int day1 = 1;\n int day2 = 2;\n int day4 = 4;\n int day5 = 5;\n\n List<ShardIndexInfo> shards = Immutabl... | {
"fields": [
{
"declarator": "log = Logger.get(ShardOrganizationManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(ShardOrganizationManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@VisibleForTesting\n static Set<OrganizationSet> createOrganizationSets(Table tableInfo, Collection<ShardIndexInfo> shards)\n {\n return getShardsByDaysBuckets(tableInfo, shards).stream()\n .map(indexInfos -> getOverlappingOrganizationSets(tableInfo, indexInfos))\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_620 | {
"fields": [
{
"declarator": "TYPE_OPERATORS_CACHE = new TypeOperators()",
"modifier": "private static final",
"original_string": "private static final TypeOperators TYPE_OPERATORS_CACHE = new TypeOperators();",
"type": "TypeOperators",
"var_name": "TYPE_OPERATORS_CACHE"
}
],
... | {
"body": "@Test\n public void testSingleStream()\n {\n List<Type> types = ImmutableList.of(INTEGER, INTEGER);\n MaterializedResult actual = mergeSortedPages(\n types,\n ImmutableList.of(0, 1),\n ImmutableList.of(ASC_NULLS_FIRST, DESC_NULLS_FIRST),\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/util/MergeSortedPages.java",
"identifier": "MergeSortedPages",
"interfaces": "",
"methods": [
{
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPag... | {
"body": "private MergeSortedPages() {}",
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPages()",
"identifier": "MergeSortedPages",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1185 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testDuplicateRequests()\n {\n ClientBuffer buffer = new ClientBuffer(TASK_INSTANCE_ID, BUFFER_ID);\n\n // add three pages\n for (int i = 0; i < 3; i++) {\n addPage(buffer, createPage(i));\n }\n assertBufferInfo(buffer, 3, 0);\n\n ... | {
"fields": [
{
"declarator": "taskInstanceId",
"modifier": "private final",
"original_string": "private final String taskInstanceId;",
"type": "String",
"var_name": "taskInstanceId"
},
{
"declarator": "bufferId",
"modifier": "private final",
"original_strin... | {
"body": "public ListenableFuture<BufferResult> getPages(long sequenceId, DataSize maxSize)\n {\n return getPages(sequenceId, maxSize, Optional.empty());\n }",
"class_method_signature": "ClientBuffer.getPages(long sequenceId, DataSize maxSize)",
"constructor": false,
"full_signature": "public List... | {
"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_335 | {
"fields": [],
"file": "presto-jdbc/src/test/java/io/prestosql/jdbc/TestPrestoDriverUri.java",
"identifier": "TestPrestoDriverUri",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUriWithUseSessionTimeZone()\n throws SQLException\n {\n Optional<Boolean> property = createDriverUri(\"presto://localhost:8080?useSessionTimeZone=true\").useSessionTimezone();\n assertTrue(property.isPresent() && property.get());\n }",
"class_meth... | {
"fields": [
{
"declarator": "JDBC_URL_START = \"jdbc:\"",
"modifier": "private static final",
"original_string": "private static final String JDBC_URL_START = \"jdbc:\";",
"type": "String",
"var_name": "JDBC_URL_START"
},
{
"declarator": "QUERY_SPLITTER = Splitter.on(... | {
"body": "public Optional<Boolean> useSessionTimezone()\n throws SQLException\n {\n return USE_SESSION_TIMEZONE.getValue(properties);\n }",
"class_method_signature": "PrestoDriverUri.useSessionTimezone()",
"constructor": false,
"full_signature": "public Optional<Boolean> useSessionTimez... | {
"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_765 | {
"fields": [
{
"declarator": "executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass()... | {
"body": "@Test\n public void testSelectNoneFilter()\n {\n PageProcessor pageProcessor = new PageProcessor(Optional.of(new SelectNoneFilter()), ImmutableList.of(new InputPageProjection(0, BIGINT)));\n\n Page inputPage = new Page(createLongSequenceBlock(0, 100));\n\n LocalMemoryContext memo... | {
"fields": [
{
"declarator": "MAX_BATCH_SIZE = 8 * 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_BATCH_SIZE = 8 * 1024;",
"type": "int",
"var_name": "MAX_BATCH_SIZE"
},
{
"declarator": "MAX_PAGE_SIZE_IN_BYTES = 4 * 1024 * 102... | {
"body": "public Iterator<Optional<Page>> process(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page)\n {\n return process(session, yieldSignal, memoryContext, page, false);\n }",
"class_method_signature": "PageProcessor.process(ConnectorSession sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_948 | {
"fields": [
{
"declarator": "MOCK_CATALOG = \"mock_catalog\"",
"modifier": "private static final",
"original_string": "private static final String MOCK_CATALOG = \"mock_catalog\";",
"type": "String",
"var_name": "MOCK_CATALOG"
},
{
"declarator": "TEST_SCHEMA = \"test_... | {
"body": "@Test\n public void testPushTopNIntoTableScan()\n {\n try (RuleTester ruleTester = defaultRuleTester()) {\n MockConnectorTableHandle connectorHandle = new MockConnectorTableHandle(TEST_SCHEMA_TABLE);\n // make the mock connector return a new connectorHandle\n M... | {
"fields": [
{
"declarator": "TABLE_SCAN = newCapture()",
"modifier": "private static final",
"original_string": "private static final Capture<TableScanNode> TABLE_SCAN = newCapture();",
"type": "Capture<TableScanNode>",
"var_name": "TABLE_SCAN"
},
{
"declarator": "PAT... | {
"body": "public PushTopNIntoTableScan(Metadata metadata)\n {\n this.metadata = metadata;\n }",
"class_method_signature": "PushTopNIntoTableScan.PushTopNIntoTableScan(Metadata metadata)",
"constructor": true,
"full_signature": "public PushTopNIntoTableScan(Metadata metadata)",
"identifier": "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_97 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/TestMetastoreTypeConfig.java",
"identifier": "TestMetastoreTypeConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(MetastoreTypeConfig.class)\n .setMetastoreType(\"thrift\"));\n }",
"class_method_signature": "TestMetastoreTypeConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public vo... | {
"fields": [
{
"declarator": "metastoreType = \"thrift\"",
"modifier": "private",
"original_string": "private String metastoreType = \"thrift\";",
"type": "String",
"var_name": "metastoreType"
}
],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/Metasto... | {
"body": "@Config(\"hive.metastore\")\n public MetastoreTypeConfig setMetastoreType(String metastoreType)\n {\n this.metastoreType = metastoreType;\n return this;\n }",
"class_method_signature": "MetastoreTypeConfig.setMetastoreType(String metastoreType)",
"constructor": false,
"full_sig... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_78 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIntegerConversion()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addIntegerValues(\"col1\", Long.valueOf(Integer.MAX_VALUE))\n .build();\n String expression = buildGlueExpression(ImmutableList.of(\"col1\"), filt... | {
"fields": [
{
"declarator": "NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\"",
"modifier": "static final",
"original_string": "static final String NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\";",
"type": "String",
"var_name": "NULL_STRING"
},
{
"declarator": "GLUE_EXPRESS... | {
"body": "public static String buildGlueExpression(List<String> columnNames, TupleDomain<String> partitionKeysFilter, boolean assumeCanonicalPartitionKeys)\n {\n return buildGlueExpression(columnNames, partitionKeysFilter, assumeCanonicalPartitionKeys, GLUE_EXPRESSION_CHAR_LIMIT);\n }",
"class_method_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1214 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/execution/scheduler/TestPhasedExecutionSchedule.java",
"identifier": "TestPhasedExecutionSchedule",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testJoin()\n {\n PlanFragment buildFragment = createTableScanPlanFragment(\"build\");\n PlanFragment probeFragment = createTableScanPlanFragment(\"probe\");\n PlanFragment joinFragment = createJoinPlanFragment(INNER, \"join\", buildFragment, probeFragment);\n\... | {
"fields": [
{
"declarator": "schedulePhases",
"modifier": "private final",
"original_string": "private final List<Set<SqlStageExecution>> schedulePhases;",
"type": "List<Set<SqlStageExecution>>",
"var_name": "schedulePhases"
},
{
"declarator": "activeSources = new Has... | {
"body": "@VisibleForTesting\n static List<Set<PlanFragmentId>> extractPhases(Collection<PlanFragment> fragments)\n {\n // Build a graph where the plan fragments are vertexes and the edges represent\n // a before -> after relationship. For example, a join hash build has an edge\n // to th... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1097 | {
"fields": [
{
"declarator": "BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(BOOLEAN))",
"modifier": "private static final",
"original_string": "private static final Function<String, Column> BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(B... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"columns and types must be present at the same time\")\n public void shouldThrowWhenColumnsAreNull()\n {\n List<Type> types = ImmutableList.of(IntegerType.INTEGER, BooleanType.BOOLEAN);\n\n Lis... | {
"fields": [
{
"declarator": "session",
"modifier": "private final",
"original_string": "private final ConnectorSession session;",
"type": "ConnectorSession",
"var_name": "session"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string"... | {
"body": "public static Builder queryResultRowsBuilder(Session session)\n {\n return new Builder(session);\n }",
"class_method_signature": "QueryResultRows.queryResultRowsBuilder(Session session)",
"constructor": false,
"full_signature": "public static Builder queryResultRowsBuilder(Session sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_677 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "re2jType = metadata.g... | {
"body": "@Test\n public void testCoerceTypeBase()\n {\n assertEquals(typeCoercion.coerceTypeBase(createDecimalType(21, 1), \"decimal\"), Optional.of(createDecimalType(21, 1)));\n assertEquals(typeCoercion.coerceTypeBase(BIGINT, \"decimal\"), Optional.of(createDecimalType(19, 0)));\n asser... | {
"fields": [
{
"declarator": "lookupType",
"modifier": "private final",
"original_string": "private final Function<TypeSignature, Type> lookupType;",
"type": "Function<TypeSignature, Type>",
"var_name": "lookupType"
}
],
"file": "presto-main/src/main/java/io/prestosql/type/T... | {
"body": "@SuppressWarnings(\"SwitchStatementWithTooFewBranches\")\n public Optional<Type> coerceTypeBase(Type sourceType, String resultTypeBase)\n {\n String sourceTypeName = sourceType.getBaseName();\n if (sourceTypeName.equals(resultTypeBase)) {\n return Optional.of(sourceType);\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_227 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testReplaceShardUuids()\n {\n long tableId = createTable(\"test\");\n List<ColumnInfo> columns = ImmutableList.of(new ColumnInfo(1, BIGINT));\n List<String> nodes = ImmutableList.of(\"node1\", \"node2\", \"node3\");\n List<UUID> originalUuids = Immutabl... | {
"fields": [
{
"declarator": "log = Logger.get(DatabaseShardManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(DatabaseShardManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "INDE... | {
"body": "@Override\n public void replaceShardUuids(long transactionId, long tableId, List<ColumnInfo> columns, Set<UUID> oldShardUuids, Collection<ShardInfo> newShards, OptionalLong updateTime)\n {\n Map<String, Integer> nodeIds = toNodeIdMap(newShards);\n\n runCommit(transactionId, (handle) -> ... | {
"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_732 | {
"fields": [
{
"declarator": "TWO = new BigInteger(\"2\")",
"modifier": "private static final",
"original_string": "private static final BigInteger TWO = new BigInteger(\"2\");",
"type": "BigInteger",
"var_name": "TWO"
},
{
"declarator": "TYPE = createDecimalType(38, 0... | {
"body": "@Test\n public void testUnderflow()\n {\n addToState(state, TWO.pow(126).negate());\n\n assertEquals(state.getLong(), 1);\n assertEquals(state.getOverflow(), 0);\n assertEquals(state.getLongDecimal(), unscaledDecimal(TWO.pow(126).negate()));\n\n addToState(state, TW... | {
"fields": [
{
"declarator": "DECIMAL_AVERAGE_AGGREGATION = new DecimalAverageAggregation()",
"modifier": "public static final",
"original_string": "public static final DecimalAverageAggregation DECIMAL_AVERAGE_AGGREGATION = new DecimalAverageAggregation();",
"type": "DecimalAverageAggreg... | {
"body": "@VisibleForTesting\n public static BigDecimal average(LongDecimalWithOverflowAndLongState state, DecimalType type)\n {\n BigDecimal sum = new BigDecimal(Decimals.decodeUnscaledValue(state.getLongDecimal()), type.getScale());\n BigDecimal count = BigDecimal.valueOf(state.getLong());\n\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_698 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestRealOperators.java",
"identifier": "TestRealOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testModulus()\n {\n assertFunction(\"REAL'12.34' % REAL'56.78'\", REAL, 12.34f % 56.78f);\n assertFunction(\"REAL'-17.34' % REAL'-22.891'\", REAL, -17.34f % -22.891f);\n assertFunction(\"REAL'-89.123' % REAL'754.0'\", REAL, -89.123f % 754.0f);\n assertF... | {
"fields": [
{
"declarator": "MIN_LONG_AS_FLOAT = -0x1p63f",
"modifier": "private static final",
"original_string": "private static final float MIN_LONG_AS_FLOAT = -0x1p63f;",
"type": "float",
"var_name": "MIN_LONG_AS_FLOAT"
},
{
"declarator": "MAX_LONG_PLUS_ONE_AS_FLO... | {
"body": "@ScalarOperator(MODULUS)\n @SqlType(StandardTypes.REAL)\n public static long modulus(@SqlType(StandardTypes.REAL) long left, @SqlType(StandardTypes.REAL) long right)\n {\n return floatToRawIntBits(intBitsToFloat((int) left) % intBitsToFloat((int) right));\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_362 | {
"fields": [],
"file": "presto-parser/src/test/java/io/prestosql/sql/parser/TestStatementSplitter.java",
"identifier": "TestStatementSplitter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSqueezeStatementAlternateDelimiter()\n {\n String sql = \"select * from\\n foo\\n order by x // \";\n assertEquals(squeezeStatement(sql), \"select * from foo order by x //\");\n }",
"class_method_signature": "TestStatementSplitter.testSqueezeStatementAlt... | {
"fields": [
{
"declarator": "completeStatements",
"modifier": "private final",
"original_string": "private final List<Statement> completeStatements;",
"type": "List<Statement>",
"var_name": "completeStatements"
},
{
"declarator": "partialStatement",
"modifier": ... | {
"body": "public static String squeezeStatement(String sql)\n {\n TokenSource tokens = getLexer(sql, ImmutableSet.of());\n StringBuilder sb = new StringBuilder();\n while (true) {\n Token token = tokens.nextToken();\n if (token.getType() == Token.EOF) {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1078 | {
"fields": [
{
"declarator": "LEFT_JOIN_COLUMN = \"left_join_column\"",
"modifier": "private static final",
"original_string": "private static final String LEFT_JOIN_COLUMN = \"left_join_column\";",
"type": "String",
"var_name": "LEFT_JOIN_COLUMN"
},
{
"declarator": "L... | {
"body": "@Test\n public void testRightJoinComplementStats()\n {\n PlanNodeStatsEstimate expected = NORMALIZER.normalize(\n planNodeStats(\n RIGHT_ROWS_COUNT * RIGHT_JOIN_COLUMN_NULLS,\n symbolStatistics(RIGHT_JOIN_COLUMN, NaN, NaN, 1.0, 0),\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": "DEFAULT_UNMATCHED_JOIN_COMPLEMENT_... | {
"body": "@VisibleForTesting\n PlanNodeStatsEstimate calculateJoinComplementStats(\n Optional<Expression> filter,\n List<JoinNode.EquiJoinClause> criteria,\n PlanNodeStatsEstimate leftStats,\n PlanNodeStatsEstimate rightStats,\n TypeProvider types)\n {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_81 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/alluxio/TestAlluxioHiveMetastoreConfig.java",
"identifier": "TestAlluxioHiveMetastoreConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(AlluxioHiveMetastoreConfig.class)\n .setMasterAddress(null));\n }",
"class_method_signature": "TestAlluxioHiveMetastoreConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test p... | {
"fields": [
{
"declarator": "masterAddress",
"modifier": "private",
"original_string": "private String masterAddress;",
"type": "String",
"var_name": "masterAddress"
}
],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/alluxio/AlluxioHiveMetastoreConfi... | {
"body": "@Config(\"hive.metastore.alluxio.master.address\")\n @ConfigDescription(\"Alluxio master address\")\n public AlluxioHiveMetastoreConfig setMasterAddress(String masterAddress)\n {\n this.masterAddress = masterAddress;\n return this;\n }",
"class_method_signature": "AlluxioHiveMet... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_548 | {
"fields": [
{
"declarator": "POSITIONS_PER_PAGE = 0",
"modifier": "private static final",
"original_string": "private static final int POSITIONS_PER_PAGE = 0;",
"type": "int",
"var_name": "POSITIONS_PER_PAGE"
},
{
"declarator": "pagesStore",
"modifier": "private... | {
"body": "@Test\n public void testInsertPage()\n {\n createTable(0L, 0L);\n insertToTable(0L, 0L);\n assertEquals(pagesStore.getPages(0L, 0, 1, ImmutableList.of(0), POSITIONS_PER_PAGE, OptionalLong.empty(), OptionalDouble.empty()).size(), 1);\n }",
"class_method_signature": "TestMemor... | {
"fields": [
{
"declarator": "maxBytes",
"modifier": "private final",
"original_string": "private final long maxBytes;",
"type": "long",
"var_name": "maxBytes"
},
{
"declarator": "currentBytes",
"modifier": "@GuardedBy(\"this\")\n private",
"original_str... | {
"body": "public synchronized List<Page> getPages(\n Long tableId,\n int partNumber,\n int totalParts,\n List<Integer> columnIndexes,\n long expectedRows,\n OptionalLong limit,\n OptionalDouble sampleRatio)\n {\n if (!contains(tab... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_118 | {
"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 testUpdatePartitionStatistics()\n {\n assertEquals(mockClient.getAccessCount(), 0);\n\n HiveMetastoreClosure hiveMetastoreClosure = new HiveMetastoreClosure(metastore);\n\n Table table = hiveMetastoreClosure.getTable(IDENTITY, TEST_DATABASE, TEST_TABLE).get();... | {
"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 void updatePartitionStatistics(HiveIdentity identity, Table table, String partitionName, Function<PartitionStatistics, PartitionStatistics> update)\n {\n identity = updateIdentity(identity);\n try {\n delegate.updatePartitionStatistics(identity, table, part... | {
"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_1202 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testDuplicateRequests()\n {\n ArbitraryOutputBuffer buffer = createArbitraryBuffer(\n createInitialEmptyOutputBuffers(ARBITRARY)\n .withBuffer(FIRST, BROADCAST_PARTITION_ID)\n .withNoMoreBufferIds(),\n ... | {
"fields": [
{
"declarator": "memoryManager",
"modifier": "private final",
"original_string": "private final OutputBufferMemoryManager memoryManager;",
"type": "OutputBufferMemoryManager",
"var_name": "memoryManager"
},
{
"declarator": "outputBuffers = createInitialEmp... | {
"body": "@Override\n public ListenableFuture<BufferResult> get(OutputBufferId bufferId, long startingSequenceId, DataSize maxSize)\n {\n checkState(!Thread.holdsLock(this), \"Cannot get pages while holding a lock on this\");\n requireNonNull(bufferId, \"bufferId is null\");\n checkArgumen... | {
"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_231 | {
"fields": [
{
"declarator": "dbi",
"modifier": "private",
"original_string": "private IDBI dbi;",
"type": "IDBI",
"var_name": "dbi"
},
{
"declarator": "dummyHandle",
"modifier": "private",
"original_string": "private Handle dummyHandle;",
"type": "Ha... | {
"body": "@Test\n public void testCleanLocalShardsImmediately()\n throws Exception\n {\n assertEquals(cleaner.getLocalShardsCleaned().getTotalCount(), 0);\n TestingShardDao shardDao = dbi.onDemand(TestingShardDao.class);\n MetadataDao metadataDao = dbi.onDemand(MetadataDao.class... | {
"fields": [
{
"declarator": "log = Logger.get(ShardCleaner.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(ShardCleaner.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dao",
"modifie... | {
"body": "@VisibleForTesting\n synchronized void cleanLocalShardsImmediately(Set<UUID> local)\n {\n // get shards assigned to the local node\n Set<UUID> assigned = dao.getNodeShards(currentNode, null).stream()\n .map(ShardMetadata::getShardUuid)\n .collect(toSet());\... | {
"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_661 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java",
"identifier": "TestTinyintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToVarchar()\n {\n assertFunction(\"cast(TINYINT'37' as varchar)\", VARCHAR, \"37\");\n assertFunction(\"cast(TINYINT'17' as varchar)\", VARCHAR, \"17\");\n }",
"class_method_signature": "TestTinyintOperators.testCastToVarchar()",
"constructor": false,
... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java",
"identifier": "TinyintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "TinyintOperators.TinyintOperators()",
"constructor": true,
"full_signature": "private TinyintOperato... | {
"body": "@ScalarOperator(CAST)\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice castToVarchar(@SqlType(StandardTypes.TINYINT) long value)\n {\n // todo optimize me\n return utf8Slice(String.valueOf(value));\n }",
"class_method_signature": "TinyintOperators.... | {
"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_1081 | {
"fields": [
{
"declarator": "LEFT_JOIN_COLUMN = \"left_join_column\"",
"modifier": "private static final",
"original_string": "private static final String LEFT_JOIN_COLUMN = \"left_join_column\";",
"type": "String",
"var_name": "LEFT_JOIN_COLUMN"
},
{
"declarator": "L... | {
"body": "@Test\n public void testAddJoinComplementStats()\n {\n double statsToAddNdv = 5;\n PlanNodeStatsEstimate statsToAdd = planNodeStats(\n RIGHT_ROWS_COUNT,\n symbolStatistics(LEFT_JOIN_COLUMN, 0.0, 5.0, 0.2, statsToAddNdv));\n\n PlanNodeStatsEstimate ad... | {
"fields": [
{
"declarator": "PATTERN = join()",
"modifier": "private static final",
"original_string": "private static final Pattern<JoinNode> PATTERN = join();",
"type": "Pattern<JoinNode>",
"var_name": "PATTERN"
},
{
"declarator": "DEFAULT_UNMATCHED_JOIN_COMPLEMENT_... | {
"body": "@VisibleForTesting\n PlanNodeStatsEstimate addJoinComplementStats(\n PlanNodeStatsEstimate sourceStats,\n PlanNodeStatsEstimate innerJoinStats,\n PlanNodeStatsEstimate joinComplementStats)\n {\n double innerJoinRowCount = innerJoinStats.getOutputRowCount();\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_374 | {
"fields": [
{
"declarator": "factory = new GeometryStateFactory()",
"modifier": "private final",
"original_string": "private final GeometryStateFactory factory = new GeometryStateFactory();",
"type": "GeometryStateFactory",
"var_name": "factory"
}
],
"file": "presto-geospat... | {
"body": "@Test\n public void testCreateGroupedStateEmpty()\n {\n GeometryState state = factory.createGroupedState();\n assertNull(state.getGeometry());\n assertTrue(state.getEstimatedSize() > 0, \"Estimated memory size was \" + state.getEstimatedSize());\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "OGC_GEOMETRY_BASE_INSTANCE_SIZE = ClassLayout.parseClass(OGCGeometry.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final long OGC_GEOMETRY_BASE_INSTANCE_SIZE = ClassLayout.parseClass(OGCGeometry.class).instanceSize()... | {
"body": "@Override\n public GeometryState createGroupedState()\n {\n return new GroupedGeometryState();\n }",
"class_method_signature": "GeometryStateFactory.createGroupedState()",
"constructor": false,
"full_signature": "@Override public GeometryState createGroupedState()",
"identifier": "c... | {
"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_724 | {
"fields": [
{
"declarator": "scheduler",
"modifier": "private",
"original_string": "private ScheduledExecutorService scheduler;",
"type": "ScheduledExecutorService",
"var_name": "scheduler"
},
{
"declarator": "pageBufferClientCallbackExecutor",
"modifier": "priv... | {
"body": "@Test\n public void testClose()\n throws Exception\n {\n DataSize maxResponseSize = DataSize.ofBytes(1);\n MockExchangeRequestProcessor processor = new MockExchangeRequestProcessor(maxResponseSize);\n\n URI location = URI.create(\"http://localhost:8080\");\n pro... | {
"fields": [
{
"declarator": "NO_MORE_PAGES = new SerializedPage(EMPTY_SLICE, PageCodecMarker.MarkerSet.empty(), 0, 0)",
"modifier": "private static final",
"original_string": "private static final SerializedPage NO_MORE_PAGES = new SerializedPage(EMPTY_SLICE, PageCodecMarker.MarkerSet.empty(),... | {
"body": "@Override\n public synchronized void close()\n {\n if (!closed.compareAndSet(false, true)) {\n return;\n }\n\n for (HttpPageBufferClient client : allClients.values()) {\n closeQuietly(client);\n }\n pageBuffer.clear();\n systemMemoryCont... | {
"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_909 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPartialConstantGroup()\n {\n List<LocalProperty<String>> actual = builder()\n .constant(\"a\")\n .grouped(\"a\", \"b\")\n .build();\n\n assertMatch(\n actual,\n builder().grouped(\"a\", \"... | {
"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_39 | {
"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 testTableRulesForCheckCanRenameTable()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanRenameTable(ADMIN, new CatalogSchemaTableName(\"some-catalog\", \"bobschema\", \"bobta... | {
"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 checkCanRenameTable(SystemSecurityContext context, CatalogSchemaTableName table, CatalogSchemaTableName newTable)\n {\n // check if user is an owner current table and will be an owner of the renamed table\n if (!checkTablePermission(context, table, OWNERSHIP) || ... | {
"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_1255 | {
"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 testTimestampNanos()\n {\n assertThat(getDomain(TIMESTAMP_NANOS, 0, null))\n .isEqualTo(none(TIMESTAMP_NANOS));\n assertThat(getDomain(TIMESTAMP_NANOS, 10, null))\n .isEqualTo(all(TIMESTAMP_NANOS));\n\n assertThat(getDomain(TIMEST... | {
"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_636 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestDoubleOperators.java",
"identifier": "TestDoubleOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testAdd()\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.1);... | {
"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(ADD)\n @SqlType(StandardTypes.DOUBLE)\n public static double add(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right)\n {\n return left + right;\n }",
"class_method_signature": "DoubleOperators.add(@SqlType(StandardTypes.DOUBLE) doubl... | {
"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_266 | {
"fields": [
{
"declarator": "DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC)",
"modifier": "private static final",
"original_string": "private static final DateTime DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC);",
"type": "DateTime",
"var_name": "DATE_TIME"
}
],
"fi... | {
"body": "@Test\n public void testDateShardRange()\n {\n assertEquals(TemporalFunction.getDayFromRange(dateRange(2, 2)), 2);\n assertEquals(TemporalFunction.getDayFromRange(dateRange(13, 13)), 13);\n\n // date is determined from lowest shard\n assertEquals(TemporalFunction.getDayFro... | {
"fields": [],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/organization/TemporalFunction.java",
"identifier": "TemporalFunction",
"interfaces": "",
"methods": [
{
"class_method_signature": "TemporalFunction.TemporalFunction()",
"constructor": true,
... | {
"body": "public static int getDayFromRange(ShardRange range)\n {\n Tuple min = range.getMinTuple();\n Tuple max = range.getMaxTuple();\n checkArgument(getOnlyElement(min.getTypes()).equals(getOnlyElement(max.getTypes())), \"type of min and max is not same\");\n\n Type type = getOnlyEl... | {
"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_289 | {
"fields": [],
"file": "presto-thrift-api/src/test/java/io/prestosql/plugin/thrift/api/datatypes/TestPrestoThriftBigint.java",
"identifier": "TestPrestoThriftBigint",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testReadBlockWrongActualType()\n {\n PrestoThriftBlock columnsData = integerData(new PrestoThriftInteger(null, null));\n columnsData.toBlock(BIGINT);\n }",
"class_method_signature": "TestPrestoThriftBigint.tes... | {
"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_773 | {
"fields": [
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "scheduledExecutor",
"modifier": "private",
"original_string": "priv... | {
"body": "@Test(dataProvider = \"hashEnabledValues\")\n public void testProbeSideNulls(boolean hashEnabled)\n {\n DriverContext driverContext = taskContext.addPipelineContext(0, true, true, false).addDriverContext();\n\n // build\n OperatorContext operatorContext = driverContext.addOperato... | {
"fields": [
{
"declarator": "pages",
"modifier": "private final",
"original_string": "private final WorkProcessor<Page> pages;",
"type": "WorkProcessor<Page>",
"var_name": "pages"
}
],
"file": "presto-main/src/main/java/io/prestosql/operator/HashSemiJoinOperator.java",
"i... | {
"body": "public static OperatorFactory createOperatorFactory(\n int operatorId,\n PlanNodeId planNodeId,\n SetSupplier setSupplier,\n List<? extends Type> probeTypes,\n int probeJoinChannel,\n Optional<Integer> probeJoinHashChannel)\n {\n r... | {
"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_323 | {
"fields": [
{
"declarator": "NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\")",
"modifier": "private static final",
"original_string": "private static final ExampleTableHandle NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\");",
"type": "Examp... | {
"body": "@Test\n public void getColumnMetadata()\n {\n assertEquals(metadata.getColumnMetadata(SESSION, NUMBERS_TABLE_HANDLE, new ExampleColumnHandle(\"text\", createUnboundedVarcharType(), 0)),\n new ColumnMetadata(\"text\", createUnboundedVarcharType()));\n\n // example connecto... | {
"fields": [
{
"declarator": "exampleClient",
"modifier": "private final",
"original_string": "private final ExampleClient exampleClient;",
"type": "ExampleClient",
"var_name": "exampleClient"
}
],
"file": "presto-example-http/src/main/java/io/prestosql/plugin/example/Exampl... | {
"body": "@Override\n public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle)\n {\n return ((ExampleColumnHandle) columnHandle).getColumnMetadata();\n }",
"class_method_signature": "ExampleMetadata.getColumnMetadata(ConnectorSes... | {
"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_1193 | {
"fields": [
{
"declarator": "PAGES_SERDE = testingPagesSerde()",
"modifier": "private static final",
"original_string": "private static final PagesSerde PAGES_SERDE = testingPagesSerde();",
"type": "PagesSerde",
"var_name": "PAGES_SERDE"
},
{
"declarator": "TASK_INSTA... | {
"body": "@Test\n public void testDuplicateRequests()\n {\n BroadcastOutputBuffer buffer = createBroadcastBuffer(\n createInitialEmptyOutputBuffers(BROADCAST)\n .withBuffer(FIRST, BROADCAST_PARTITION_ID)\n .withNoMoreBufferIds(),\n ... | {
"fields": [
{
"declarator": "taskInstanceId",
"modifier": "private final",
"original_string": "private final String taskInstanceId;",
"type": "String",
"var_name": "taskInstanceId"
},
{
"declarator": "state",
"modifier": "private final",
"original_string":... | {
"body": "@Override\n public ListenableFuture<BufferResult> get(OutputBufferId outputBufferId, long startingSequenceId, DataSize maxSize)\n {\n checkState(!Thread.holdsLock(this), \"Cannot get pages while holding a lock on this\");\n requireNonNull(outputBufferId, \"outputBufferId is null\");\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_1039 | {
"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 testExplainAnalyze()\n {\n analyze(\"EXPLAIN ANALYZE SELECT * FROM t1\");\n }",
"class_method_signature": "TestAnalyzer.testExplainAnalyze()",
"constructor": false,
"full_signature": "@Test public void testExplainAnalyze()",
"identifier": "testExplainAnalyze",
... | {
"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_42 | {
"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 testFilterCatalogs()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-visibility.json\");\n Set<String> allCatalogs = ImmutableSet.of(\n \"alice-catalog\",\n \"bob-catalog\",\n ... | {
"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> filterCatalogs(SystemSecurityContext context, Set<String> catalogs)\n {\n ImmutableSet.Builder<String> filteredCatalogs = ImmutableSet.builder();\n for (String catalog : catalogs) {\n if (checkAnyCatalogAccess(context, catalog)) {\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_837 | {
"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 testSqrt()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"sqrt(\" + doubleValue + \")\", DOUBLE, Math.sqrt(doubleValue));\n assertFunction(\"sqrt(REAL '\" + doubleValue + \"')\", DOUBLE, Math.sqrt((float) doubleValue));\n }\... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Square root\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double sqrt(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.sqrt(num);\n }",
"class_method_signature": "MathFunctions.sqrt(@SqlType(StandardTypes.DOUBLE) double num)",
"co... | {
"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_134 | {
"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 testCalculateDistinctPartitionKeys()\n {\n assertEquals(calculateDistinctPartitionKeys(PARTITION_COLUMN_1, ImmutableList.of()), 0);\n assertEquals(\n calculateDistinctPartitionKeys(\n PARTITION_COLUMN_1,\n ... | {
"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 long calculateDistinctPartitionKeys(\n HiveColumnHandle column,\n List<HivePartition> partitions)\n {\n return partitions.stream()\n .map(partition -> partition.getKeys().get(column))\n .filter(value -> !value.isNu... | {
"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_564 | {
"fields": [
{
"declarator": "SPLIT_SIZE = 100",
"modifier": "private static final",
"original_string": "private static final int SPLIT_SIZE = 100;",
"type": "int",
"var_name": "SPLIT_SIZE"
},
{
"declarator": "KEYSPACE = \"test_cassandra_token_split_manager_keyspace\""... | {
"body": "@Test\n public void testPartitionCountOverride()\n throws Exception\n {\n String tableName = \"partition_count_override_table\";\n session.execute(format(\"CREATE TABLE %s.%s (key text PRIMARY KEY)\", KEYSPACE, tableName));\n server.refreshSizeEstimates(KEYSPACE, table... | {
"fields": [
{
"declarator": "session",
"modifier": "private final",
"original_string": "private final CassandraSession session;",
"type": "CassandraSession",
"var_name": "session"
},
{
"declarator": "splitSize",
"modifier": "private final",
"original_strin... | {
"body": "public long getTotalPartitionsCount(String keyspace, String table, Optional<Long> sessionSplitsPerNode)\n {\n if (sessionSplitsPerNode.isPresent()) {\n return sessionSplitsPerNode.get();\n }\n if (configSplitsPerNode.isPresent()) {\n return configSplitsPerNode.... | {
"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_421 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTGeometries()\n {\n assertFunction(\"ST_Geometries(ST_GeometryFromText('POINT EMPTY'))\", new ArrayType(GEOMETRY), null);\n assertSTGeometries(\"POINT (1 5)\", \"POINT (1 5)\");\n assertSTGeometries(\"LINESTRING (77.29 29.07, 77.42 29.26, 77.27 29.31, 77.... | {
"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 geometries in the specified collection\")\n @ScalarFunction(\"ST_Geometries\")\n @SqlType(\"array(\" + GEOMETRY_TYPE_NAME + \")\")\n public static Block stGeometries(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry ... | {
"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_972 | {
"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 testValueExpressionRewrite()\n {\n tester().assertThat(zeroRewriter.valuesExpressionRewrite())\n .on(p -> p.values(\n ImmutableList.<Symbol>of(p.symbol(\"a\")),\n ImmutableList.of((ImmutableList.of(PlanBuilder.exp... | {
"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<?> valuesExpressionRewrite()\n {\n return new ValuesExpressionRewrite(rewriter);\n }",
"class_method_signature": "ExpressionRewriteRuleSet.valuesExpressionRewrite()",
"constructor": false,
"full_signature": "public Rule<?> valuesExpressionRewrite()",
"identifier": "valuesEx... | {
"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_708 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/security/TestAccessControlConfig.java",
"identifier": "TestAccessControlConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n throws IOException\n {\n Path config1 = Files.createTempFile(null, null);\n Path config2 = Files.createTempFile(null, null);\n\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n ... | {
"fields": [
{
"declarator": "SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings()",
"modifier": "private static final",
"original_string": "private static final Splitter SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings();",
"type": "Splitter",
"var_name": "SPLITTE... | {
"body": "@Config(\"access-control.config-files\")\n public AccessControlConfig setAccessControlFiles(String accessControlFiles)\n {\n this.accessControlFiles = SPLITTER.splitToList(accessControlFiles).stream()\n .map(File::new)\n .collect(toImmutableList());\n retur... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_358 | {
"fields": [],
"file": "presto-parser/src/test/java/io/prestosql/sql/parser/TestStatementSplitter.java",
"identifier": "TestStatementSplitter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsEmptyStatement()\n {\n assertTrue(isEmptyStatement(\"\"));\n assertTrue(isEmptyStatement(\" \"));\n assertTrue(isEmptyStatement(\"\\t\\n \"));\n assertTrue(isEmptyStatement(\"--foo\\n --what\"));\n assertTrue(isEmptyStatement(\"/* oops */\... | {
"fields": [
{
"declarator": "completeStatements",
"modifier": "private final",
"original_string": "private final List<Statement> completeStatements;",
"type": "List<Statement>",
"var_name": "completeStatements"
},
{
"declarator": "partialStatement",
"modifier": ... | {
"body": "public static boolean isEmptyStatement(String sql)\n {\n TokenSource tokens = getLexer(sql, ImmutableSet.of());\n while (true) {\n Token token = tokens.nextToken();\n if (token.getType() == Token.EOF) {\n return true;\n }\n if (tok... | {
"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_1042 | {
"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 testRecursiveBaseRelationAliasing()\n {\n // base relation anonymous\n analyze(\"WITH RECURSIVE t(n, m) AS (\" +\n \" SELECT * FROM (VALUES(1, 2), (4, 100))\" +\n \" UNION ALL\" +\n \" SELECT 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_1107 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/TestPrestoSystemRequirements.java",
"identifier": "TestPrestoSystemRequirements",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifyJvmRequirements()\n {\n verifyJvmRequirements();\n }",
"class_method_signature": "TestPrestoSystemRequirements.testVerifyJvmRequirements()",
"constructor": false,
"full_signature": "@Test public void testVerifyJvmRequirements()",
"identifier": "testVeri... | {
"fields": [
{
"declarator": "MIN_FILE_DESCRIPTORS = 4096",
"modifier": "private static final",
"original_string": "private static final int MIN_FILE_DESCRIPTORS = 4096;",
"type": "int",
"var_name": "MIN_FILE_DESCRIPTORS"
},
{
"declarator": "RECOMMENDED_FILE_DESCRIPTOR... | {
"body": "public static void verifyJvmRequirements()\n {\n verifyJavaVersion();\n verify64BitJvm();\n verifyOsArchitecture();\n verifyByteOrder();\n verifyUsingG1Gc();\n verifyFileDescriptor();\n verifySlice();\n }",
"class_method_signature": "PrestoSystemRequ... | {
"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_533 | {
"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 testSelectorResourceEstimate()\n {\n ResourceGroupId resourceGroupId = new ResourceGroupId(new ResourceGroupId(\"global\"), \"foo\");\n\n StaticSelector smallQuerySelector = new StaticSelector(\n Optional.empty(),\n Optional.empty(),\n ... | {
"fields": [
{
"declarator": "NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\")",
"modifier": "private static final",
"original_string": "private static final Pattern NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\");",
"type": "Pa... | {
"body": "@Override\n public Optional<SelectionContext<ResourceGroupIdTemplate>> match(SelectionCriteria criteria)\n {\n Map<String, String> variables = new HashMap<>();\n\n if (userRegex.isPresent()) {\n Matcher userMatcher = userRegex.get().matcher(criteria.getUser());\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_499 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestRange.java",
"identifier": "TestRange",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSpan()\n {\n assertEquals(Range.greaterThan(BIGINT, 1L).span(Range.lessThanOrEqual(BIGINT, 2L)), Range.all(BIGINT));\n assertEquals(Range.greaterThan(BIGINT, 2L).span(Range.lessThanOrEqual(BIGINT, 0L)), Range.all(BIGINT));\n assertEquals(Range.range(BIGINT... | {
"fields": [
{
"declarator": "low",
"modifier": "private final",
"original_string": "private final Marker low;",
"type": "Marker",
"var_name": "low"
},
{
"declarator": "high",
"modifier": "private final",
"original_string": "private final Marker high;",
... | {
"body": "public Range span(Range other)\n {\n checkTypeCompatibility(other);\n Marker lowMarker = Marker.min(low, other.getLow());\n Marker highMarker = Marker.max(high, other.getHigh());\n return new Range(lowMarker, highMarker);\n }",
"class_method_signature": "Range.span(Range... | {
"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_163 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveColumnHandle.java",
"identifier": "TestHiveColumnHandle",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPartitionKeyColumn()\n {\n HiveColumnHandle expectedRegularColumn = createBaseColumn(\"name\", 88, HiveType.HIVE_FLOAT, DOUBLE, REGULAR, Optional.empty());\n testRoundTrip(expectedRegularColumn);\n }",
"class_method_signature": "TestHiveColumnHandle.testPart... | {
"fields": [
{
"declarator": "PATH_COLUMN_INDEX = -11",
"modifier": "public static final",
"original_string": "public static final int PATH_COLUMN_INDEX = -11;",
"type": "int",
"var_name": "PATH_COLUMN_INDEX"
},
{
"declarator": "PATH_COLUMN_NAME = \"$path\"",
"mo... | {
"body": "public static HiveColumnHandle createBaseColumn(\n String topLevelColumnName,\n int topLevelColumnIndex,\n HiveType hiveType,\n Type type,\n ColumnType columnType,\n Optional<String> comment)\n {\n return new HiveColumnHandle(topLe... | {
"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_1279 | {
"fields": [
{
"declarator": "NO_CREATED_BY = Optional.empty()",
"modifier": "private static final",
"original_string": "private static final Optional<String> NO_CREATED_BY = Optional.empty();",
"type": "Optional<String>",
"var_name": "NO_CREATED_BY"
},
{
"declarator":... | {
"body": "@Test(dataProvider = \"allCreatedBy\")\n public void testReadStatsBinaryUtf8(Optional<String> fileCreatedBy)\n {\n PrimitiveType varchar = new PrimitiveType(OPTIONAL, BINARY, \"Test column\", OriginalType.UTF8);\n Statistics statistics;\n\n // Stats written by Parquet after https... | {
"fields": [
{
"declarator": "MAGIC = Slices.utf8Slice(\"PAR1\")",
"modifier": "private static final",
"original_string": "private static final Slice MAGIC = Slices.utf8Slice(\"PAR1\");",
"type": "Slice",
"var_name": "MAGIC"
},
{
"declarator": "POST_SCRIPT_SIZE = Integ... | {
"body": "public static org.apache.parquet.column.statistics.Statistics<?> readStats(Optional<String> fileCreatedBy, Optional<Statistics> statisticsFromFile, PrimitiveType type)\n {\n Statistics statistics = statisticsFromFile.orElse(null);\n org.apache.parquet.column.statistics.Statistics<?> column... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_15 | {
"fields": [],
"file": "presto-geospatial-toolkit/src/test/java/io/prestosql/geospatial/TestKdbTree.java",
"identifier": "TestKdbTree",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerde()\n {\n Rectangle extent = new Rectangle(0, 0, 9, 4);\n ImmutableList.Builder<Rectangle> rectangles = ImmutableList.builder();\n for (double x = 0; x < 10; x += 1) {\n for (double y = 0; y < 5; y += 1) {\n rectangles.add(new... | {
"fields": [
{
"declarator": "MAX_LEVELS = 10_000",
"modifier": "private static final",
"original_string": "private static final int MAX_LEVELS = 10_000;",
"type": "int",
"var_name": "MAX_LEVELS"
},
{
"declarator": "root",
"modifier": "private final",
"orig... | {
"body": "public static KdbTree buildKdbTree(int maxItemsPerNode, Rectangle extent, List<Rectangle> items)\n {\n checkArgument(maxItemsPerNode > 0, \"maxItemsPerNode must be > 0\");\n requireNonNull(extent, \"extent is null\");\n requireNonNull(items, \"items is null\");\n return new K... | {
"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_860 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testLevenshteinDistance()\n {\n assertFunction(\"LEVENSHTEIN_DISTANCE('', '')\", BIGINT, 0L);\n assertFunction(\"LEVENSHTEIN_DISTANCE('', 'hello')\", BIGINT, 5L);\n assertFunction(\"LEVENSHTEIN_DISTANCE('hello', '')\", BIGINT, 5L);\n assertFunction(\"LE... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Computes Levenshtein distance between two strings\")\n @ScalarFunction\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(StandardTypes.BIGINT)\n public static long levenshteinDistance(@SqlType(\"varchar(x)\") Slice left, @SqlType(\"varchar(y)\") Slice right)\n {\n int[] 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_925 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java",
"identifier": "TestLogicalPlanner",
"interfaces": "",
"superclass": "extends BasePlanTest"
} | {
"body": "@Test\n public void testSameScalarSubqueryIsAppliedOnlyOnce()\n {\n // three subqueries with two duplicates (coerced to two different types), only two scalar joins should be in plan\n assertEquals(\n countOfMatchingNodes(\n plan(\"SELECT * \" +\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_476 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestAllOrNoneValueSet.java",
"identifier": "TestAllOrNoneValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIntersect()\n {\n AllOrNoneValueSet all = AllOrNoneValueSet.all(HYPER_LOG_LOG);\n AllOrNoneValueSet none = AllOrNoneValueSet.none(HYPER_LOG_LOG);\n\n assertEquals(all.intersect(all), all);\n assertEquals(all.intersect(none), none);\n assertEq... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "all",
"modifier": "private final",
"original_string": "private final boolean all;",
... | {
"body": "@Override\n public ValueSet intersect(ValueSet other)\n {\n AllOrNoneValueSet otherValueSet = checkCompatibility(other);\n return new AllOrNoneValueSet(type, all && otherValueSet.all);\n }",
"class_method_signature": "AllOrNoneValueSet.intersect(ValueSet other)",
"constructor": f... | {
"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_1015 | {
"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 testGroupByWithExistsSelectExpression()\n {\n analyze(\"SELECT EXISTS(SELECT t1.a) FROM t1 GROUP BY a\");\n analyze(\"SELECT EXISTS(SELECT a) FROM t1 GROUP BY t1.a\");\n\n // u.a is not GROUP-ed BY and it is used in select Subquery expression\n analyze(... | {
"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_1150 | {
"fields": [
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "invoked",
"modifier": "private static",
"original_string": "private... | {
"body": "@Test\n public void testExecute()\n {\n TransactionManager transactionManager = createTransactionManager();\n MetadataManager metadata = createMetadataManager(transactionManager);\n\n AccessControl accessControl = new AllowAllAccessControl();\n QueryStateMachine stateMachi... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CallTask.java",
"identifier": "CallTask",
"interfaces": "implements DataDefinitionTask<Call>",
"methods": [
{
"class_method_signature": "CallTask.getName()",
"constructor": false,
"full_signature": "@Override publi... | {
"body": "@Override\n public ListenableFuture<?> execute(Call call, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n if (!transactionManager.isAutoCommit(stateMachine.getSession().getRequiredTransact... | {
"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_876 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCharLower()\n {\n assertFunction(\"LOWER(CAST('' AS CHAR(10)))\", createCharType(10), padRight(\"\", 10));\n assertFunction(\"LOWER(CAST('Hello World' AS CHAR(11)))\", createCharType(11), padRight(\"hello world\", 11));\n assertFunction(\"LOWER(CAST('WHAT!... | {
"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(\"Converts the string to lower case\")\n @ScalarFunction(\"lower\")\n @LiteralParameters(\"x\")\n @SqlType(\"char(x)\")\n public static Slice charLower(@SqlType(\"char(x)\") Slice slice)\n {\n return lower(slice);\n }",
"class_method_signature": "StringFunctions.char... | {
"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_175 | {
"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\n public void testNoHangIfPartitionIsOffline()\n {\n BackgroundHiveSplitLoader backgroundHiveSplitLoader = backgroundHiveSplitLoaderOfflinePartitions();\n HiveSplitSource hiveSplitSource = hiveSplitSource(backgroundHiveSplitLoader);\n backgroundHiveSplitLoader.start(hiveSpl... | {
"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_525 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestCsvPrinter.java",
"identifier": "TestCsvPrinter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCsvPrintingNoRowsWithNoHeaderAndWithoutQuotes()\n throws Exception\n {\n StringWriter writer = new StringWriter();\n List<String> fieldNames = ImmutableList.of(\"first\", \"last\", \"quantity\");\n OutputPrinter printer = new CsvPrinter(fieldNam... | {
"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_460 | {
"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 testShiftLeftCompareToBigInteger()\n {\n assertShiftLeft(new BigInteger(\"446319580078125\"), 19);\n\n assertShiftLeft(TWO.pow(1), 10);\n assertShiftLeft(TWO.pow(5).add(TWO.pow(1)), 10);\n assertShiftLeft(TWO.pow(1), 100);\n assertShiftLeft(TWO.p... | {
"fields": [
{
"declarator": "NUMBER_OF_LONGS = 2",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_LONGS = 2;",
"type": "int",
"var_name": "NUMBER_OF_LONGS"
},
{
"declarator": "NUMBER_OF_INTS = 2 * NUMBER_OF_LONGS",
"mo... | {
"body": "public static Slice add(Slice left, Slice right)\n {\n Slice result = unscaledDecimal();\n add(left, right, result);\n return result;\n }",
"class_method_signature": "UnscaledDecimal128Arithmetic.add(Slice left, Slice right)",
"constructor": false,
"full_signature": "public... | {
"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_933 | {
"fields": [
{
"declarator": "COLUMNS = ImmutableList.of(\"\", \"col1\", \"$:###:;\", \"abc+dddd___\")",
"modifier": "private static final",
"original_string": "private static final ImmutableList<String> COLUMNS = ImmutableList.of(\"\", \"col1\", \"$:###:;\", \"abc+dddd___\");",
"type": "... | {
"body": "@Test\n public void testSerializationRoundTrip()\n {\n JsonCodec<StatisticAggregationsDescriptor<Symbol>> codec = JsonCodec.jsonCodec(new TypeToken<>() {});\n assertSerializationRoundTrip(codec, StatisticAggregationsDescriptor.<Symbol>builder().build());\n assertSerializationRoun... | {
"fields": [
{
"declarator": "grouping",
"modifier": "private final",
"original_string": "private final Map<String, T> grouping;",
"type": "Map<String, T>",
"var_name": "grouping"
},
{
"declarator": "tableStatistics",
"modifier": "private final",
"original_... | {
"body": "public static <B> Builder<B> builder()\n {\n return new Builder<>();\n }",
"class_method_signature": "StatisticAggregationsDescriptor.builder()",
"constructor": false,
"full_signature": "public static Builder<B> builder()",
"identifier": "builder",
"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_899 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNormalizeSingleSmbolGroup()\n {\n List<LocalProperty<String>> localProperties = builder().grouped(\"a\").build();\n assertNormalize(localProperties, Optional.of(grouped(\"a\")));\n assertNormalizeAndFlatten(localProperties, grouped(\"a\"));\n }",
"cla... | {
"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_1280 | {
"fields": [
{
"declarator": "NO_CREATED_BY = Optional.empty()",
"modifier": "private static final",
"original_string": "private static final Optional<String> NO_CREATED_BY = Optional.empty();",
"type": "Optional<String>",
"var_name": "NO_CREATED_BY"
},
{
"declarator":... | {
"body": "@Test(dataProvider = \"allCreatedBy\")\n public void testReadNullStats(Optional<String> fileCreatedBy)\n {\n // integer\n assertThat(MetadataReader.readStats(fileCreatedBy, Optional.empty(), new PrimitiveType(OPTIONAL, INT32, \"Test column\")))\n .isInstanceOfSatisfying(\... | {
"fields": [
{
"declarator": "MAGIC = Slices.utf8Slice(\"PAR1\")",
"modifier": "private static final",
"original_string": "private static final Slice MAGIC = Slices.utf8Slice(\"PAR1\");",
"type": "Slice",
"var_name": "MAGIC"
},
{
"declarator": "POST_SCRIPT_SIZE = Integ... | {
"body": "public static org.apache.parquet.column.statistics.Statistics<?> readStats(Optional<String> fileCreatedBy, Optional<Statistics> statisticsFromFile, PrimitiveType type)\n {\n Statistics statistics = statisticsFromFile.orElse(null);\n org.apache.parquet.column.statistics.Statistics<?> column... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_749 | {
"fields": [
{
"declarator": "TYPE_OPERATORS_CACHE = new TypeOperators()",
"modifier": "private static final",
"original_string": "private static final TypeOperators TYPE_OPERATORS_CACHE = new TypeOperators();",
"type": "TypeOperators",
"var_name": "TYPE_OPERATORS_CACHE"
},
... | {
"body": "@Test\n public void testFindEndPosition()\n {\n assertFindEndPosition(\"0\", 1);\n assertFindEndPosition(\"11\", 2);\n assertFindEndPosition(\"1111111111\", 10);\n\n assertFindEndPosition(\"01\", 1);\n assertFindEndPosition(\"011\", 1);\n assertFindEndPositio... | {
"fields": [
{
"declarator": "operatorContext",
"modifier": "private final",
"original_string": "private final OperatorContext operatorContext;",
"type": "OperatorContext",
"var_name": "operatorContext"
},
{
"declarator": "outputTypes",
"modifier": "private final... | {
"body": "@VisibleForTesting\n static int findEndPosition(int startPosition, int endPosition, BiPredicate<Integer, Integer> comparator)\n {\n checkArgument(startPosition >= 0, \"startPosition must be greater or equal than zero: %s\", startPosition);\n checkArgument(startPosition < endPosition, \"... | {
"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_319 | {
"fields": [
{
"declarator": "NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\")",
"modifier": "private static final",
"original_string": "private static final ExampleTableHandle NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\");",
"type": "Examp... | {
"body": "@Test\n public void testGetTableHandle()\n {\n assertEquals(metadata.getTableHandle(SESSION, new SchemaTableName(\"example\", \"numbers\")), NUMBERS_TABLE_HANDLE);\n assertNull(metadata.getTableHandle(SESSION, new SchemaTableName(\"example\", \"unknown\")));\n assertNull(metadata... | {
"fields": [
{
"declarator": "exampleClient",
"modifier": "private final",
"original_string": "private final ExampleClient exampleClient;",
"type": "ExampleClient",
"var_name": "exampleClient"
}
],
"file": "presto-example-http/src/main/java/io/prestosql/plugin/example/Exampl... | {
"body": "@Override\n public ExampleTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)\n {\n if (!listSchemaNames(session).contains(tableName.getSchemaName())) {\n return null;\n }\n\n ExampleTable table = exampleClient.getTable(tableName.getSchemaNa... | {
"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_1003 | {
"fields": [
{
"declarator": "metadata = MetadataManager.createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = MetadataManager.createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
}
],
"file": "p... | {
"body": "@Test\n public void testDouble()\n {\n List<RowExpression> values = new ArrayList<>();\n values.add(constant(1.5, DOUBLE));\n values.add(constant(2.5, DOUBLE));\n values.add(constant(3.5, DOUBLE));\n assertEquals(checkSwitchGenerationCase(DOUBLE, values), HASH_SWITC... | {
"fields": [
{
"declarator": "valueExpression",
"modifier": "private final",
"original_string": "private final RowExpression valueExpression;",
"type": "RowExpression",
"var_name": "valueExpression"
},
{
"declarator": "testExpressions",
"modifier": "private final... | {
"body": "@VisibleForTesting\n static SwitchGenerationCase checkSwitchGenerationCase(Type type, List<RowExpression> values)\n {\n if (values.size() > 32) {\n // 32 is chosen because\n // * SET_CONTAINS performs worst when smaller than but close to power of 2\n // * Bench... | {
"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_1146 | {
"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 testParameterMismatchWithFetchFirst()\n {\n Session session = testSessionBuilder()\n .addPreparedStatement(\"my_query\", \"SELECT ? FROM foo FETCH FIRST ? ROWS ONLY\")\n .build();\n assertPrestoExceptionThrownBy(() -> QUERY_PREPARER.prep... | {
"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_572 | {
"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 testRetryAndStopOnSqlException()\n {\n MockConnectorFactory mock = new MockConnectorFactory(THROW_SQL_RECOVERABLE_EXCEPTION, THROW_SQL_EXCEPTION);\n ConnectionFactory factory = new RetryingConnectionFactory(mock);\n assertThatThrownBy(() -> factory.openConnect... | {
"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_122 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/s3/TestHiveS3TypeConfig.java",
"identifier": "TestHiveS3TypeConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(HiveS3TypeConfig.class)\n .setS3FileSystemType(S3FileSystemType.PRESTO));\n }",
"class_method_signature": "TestHiveS3TypeConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "s3FileSystemType = S3FileSystemType.PRESTO",
"modifier": "private",
"original_string": "private S3FileSystemType s3FileSystemType = S3FileSystemType.PRESTO;",
"type": "S3FileSystemType",
"var_name": "s3FileSystemType"
}
],
"file": "presto-hive/s... | {
"body": "@Config(\"hive.s3-file-system-type\")\n public HiveS3TypeConfig setS3FileSystemType(S3FileSystemType s3FileSystemType)\n {\n this.s3FileSystemType = s3FileSystemType;\n return this;\n }",
"class_method_signature": "HiveS3TypeConfig.setS3FileSystemType(S3FileSystemType s3FileSystemT... | {
"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_1238 | {
"fields": [],
"file": "presto-pinot/src/test/java/io/prestosql/pinot/query/TestDynamicTable.java",
"identifier": "TestDynamicTable",
"interfaces": "",
"superclass": "extends TestPinotQueryBase"
} | {
"body": "@Test\n public void testOfflineDynamicTable()\n {\n String tableName = hybridTable.getTableName();\n String tableNameWithSuffix = tableName + OFFLINE_SUFFIX;\n String query = format(\"select * from %s limit 70\", tableNameWithSuffix);\n DynamicTable dynamicTable = buildFro... | {
"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_821 | {
"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 testLog2()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"log2(\" + doubleValue + \")\", DOUBLE, Math.log(doubleValue) / Math.log(2));\n }\n assertFunction(\"log2(NULL)\", DOUBLE, null);\n }",
"class_method_signature": "Tes... | {
"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(\"Logarithm to base 2\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double log2(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.log(num) / Math.log(2);\n }",
"class_method_signature": "MathFunctions.log2(@SqlType(StandardTypes.DOUBLE... | {
"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_54 | {
"fields": [
{
"declarator": "tester = new JsonFieldDecoderTester(\"milliseconds-since-epoch\")",
"modifier": "private",
"original_string": "private JsonFieldDecoderTester tester = new JsonFieldDecoderTester(\"milliseconds-since-epoch\");",
"type": "JsonFieldDecoderTester",
"var_nam... | {
"body": "@Test\n public void testDecode()\n {\n tester.assertDecodedAs(\"33701000\", TIME, 33_701_000_000_000_000L);\n tester.assertDecodedAs(\"\\\"33701000\\\"\", TIME, 33_701_000_000_000_000L);\n tester.assertDecodedAs(\"33701000\", TIME_WITH_TIME_ZONE, packTimeWithTimeZone(33_701_000_0... | {
"fields": [
{
"declarator": "SUPPORTED_TYPES = ImmutableSet.of(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(TIME, TIME_WITH_TIME_ZONE, TIMESTAMP_... | {
"body": "@Override\n public FieldValueProvider decode(JsonNode value)\n {\n return new MillisecondsSinceEpochJsonValueProvider(value, columnHandle);\n }",
"class_method_signature": "MillisecondsSinceEpochJsonFieldDecoder.decode(JsonNode value)",
"constructor": false,
"full_signature": "@Overri... | {
"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_964 | {
"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 testDoesNotChangeOrderWithoutCrossJoin()\n {\n PlanNode plan =\n joinNode(\n joinNode(\n values(\"a\"),\n values(\"b\"),\n \"a\", \"b\"),\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_437 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestSqlTimestamp.java",
"identifier": "TestSqlTimestamp",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRoundTo()\n {\n // positive epoch, round down\n assertThat(newInstance(12, 111111, 111111).roundTo(0).toString()).isEqualTo(\"1970-01-01 00:00:00\");\n assertThat(newInstance(12, 111111, 111111).roundTo(1).toString()).isEqualTo(\"1970-01-01 00:00:00.1\");\... | {
"fields": [
{
"declarator": "precision",
"modifier": "private final",
"original_string": "private final int precision;",
"type": "int",
"var_name": "precision"
},
{
"declarator": "epochMicros",
"modifier": "private final",
"original_string": "private final... | {
"body": "public SqlTimestamp roundTo(int precision)\n {\n return newInstanceWithRounding(precision, epochMicros, picosOfMicros);\n }",
"class_method_signature": "SqlTimestamp.roundTo(int precision)",
"constructor": false,
"full_signature": "public SqlTimestamp roundTo(int precision)",
"identifi... | {
"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_1054 | {
"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 testCreateSchema()\n {\n analyze(\"CREATE SCHEMA test\");\n analyze(\"CREATE SCHEMA test WITH (p1 = 'p1')\");\n\n assertFails(\"CREATE SCHEMA test WITH (p1 = y)\")\n .hasErrorCode(COLUMN_NOT_FOUND)\n .hasMessageMatching(\".*Column... | {
"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_1111 | {
"fields": [
{
"declarator": "testFile",
"modifier": "private",
"original_string": "private File testFile;",
"type": "File",
"var_name": "testFile"
}
],
"file": "presto-main/src/test/java/io/prestosql/server/security/TestUserMapping.java",
"identifier": "TestUserMapping",
... | {
"body": "@Test\n public void testReplacePatternRule()\n throws Exception\n {\n UserMapping userMapping = new UserMapping(ImmutableList.of(new Rule(\"(.*?)@.*\", \"$1 ^ $1\", true, KEEP)));\n assertEquals(userMapping.mapUser(\"test@example.com\"), \"test ^ test\");\n assertThrow... | {
"fields": [
{
"declarator": "rules",
"modifier": "private final",
"original_string": "private final List<Rule> rules;",
"type": "List<Rule>",
"var_name": "rules"
}
],
"file": "presto-main/src/main/java/io/prestosql/server/security/UserMapping.java",
"identifier": "UserMap... | {
"body": "public String mapUser(String principal)\n throws UserMappingException\n {\n for (Rule rule : rules) {\n Optional<String> user = rule.mapUser(principal);\n if (user.isPresent()) {\n return user.get();\n }\n }\n\n throw new Us... | {
"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_1166 | {
"fields": [
{
"declarator": "CATALOG_NAME = \"catalog\"",
"modifier": "private static final",
"original_string": "private static final String CATALOG_NAME = \"catalog\";",
"type": "String",
"var_name": "CATALOG_NAME"
},
{
"declarator": "PARENT_TABLE = new ConnectorTab... | {
"body": "@Test\n public void testCreateLike()\n {\n CreateTable statement = getCreatleLikeStatement(false);\n\n getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, List.of()));\n assertEquals(metadata.getCreateTableCallCount(... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CreateTableTask.java",
"identifier": "CreateTableTask",
"interfaces": "implements DataDefinitionTask<CreateTable>",
"methods": [
{
"class_method_signature": "CreateTableTask.getName()",
"constructor": false,
"full_... | {
"body": "@VisibleForTesting\n ListenableFuture<?> internalExecute(CreateTable statement, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters)\n {\n checkArgument(!statement.getElements().isEmpty(), \"no columns for table\");\n\n Map<NodeRef<Parameter>, Ex... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_786 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestBitwiseFunctions.java",
"identifier": "TestBitwiseFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testBitwiseXor()\n {\n assertFunction(\"bitwise_xor(0, -1)\", BIGINT, -1L);\n assertFunction(\"bitwise_xor(3, 8)\", BIGINT, 3L ^ 8L);\n assertFunction(\"bitwise_xor(-4, 12)\", BIGINT, -4L ^ 12L);\n assertFunction(\"bitwise_xor(60, 21)\", BIGINT, 60L ^ 2... | {
"fields": [
{
"declarator": "TINYINT_MASK = 0b1111_1111L",
"modifier": "private static final",
"original_string": "private static final long TINYINT_MASK = 0b1111_1111L;",
"type": "long",
"var_name": "TINYINT_MASK"
},
{
"declarator": "TINYINT_SIGNED_BIT = 0b1000_0000L... | {
"body": "@Description(\"Bitwise XOR in 2's complement arithmetic\")\n @ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long bitwiseXor(@SqlType(StandardTypes.BIGINT) long left, @SqlType(StandardTypes.BIGINT) long right)\n {\n return left ^ right;\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_293 | {
"fields": [],
"file": "presto-thrift-api/src/test/java/io/prestosql/plugin/thrift/api/valuesets/TestPrestoThriftRangeValueSet.java",
"identifier": "TestPrestoThriftRangeValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFromValueSetAll()\n {\n PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.all(BIGINT));\n assertNotNull(thriftValueSet.getRangeValueSet());\n assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of(\n new Prest... | {
"fields": [
{
"declarator": "ranges",
"modifier": "private final",
"original_string": "private final List<PrestoThriftRange> ranges;",
"type": "List<PrestoThriftRange>",
"var_name": "ranges"
}
],
"file": "presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/values... | {
"body": "@ThriftField(1)\n public List<PrestoThriftRange> getRanges()\n {\n return ranges;\n }",
"class_method_signature": "PrestoThriftRangeValueSet.getRanges()",
"constructor": false,
"full_signature": "@ThriftField(1) public List<PrestoThriftRange> getRanges()",
"identifier": "getRanges",... | {
"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_769 | {
"fields": [
{
"declarator": "executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass()... | {
"body": "@Test\n public void testExpressionProfiler()\n {\n Metadata metadata = createTestMetadataManager();\n CallExpression add10Expression = call(\n metadata.resolveOperator(ADD, ImmutableList.of(BIGINT, BIGINT)),\n field(0, BIGINT),\n constant(10L... | {
"fields": [
{
"declarator": "MAX_BATCH_SIZE = 8 * 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_BATCH_SIZE = 8 * 1024;",
"type": "int",
"var_name": "MAX_BATCH_SIZE"
},
{
"declarator": "MAX_PAGE_SIZE_IN_BYTES = 4 * 1024 * 102... | {
"body": "public Iterator<Optional<Page>> process(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page)\n {\n return process(session, yieldSignal, memoryContext, page, false);\n }",
"class_method_signature": "PageProcessor.process(ConnectorSession sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_339 | {
"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 testGetDatabaseProductVersion()\n throws Exception\n {\n try (Connection connection = createConnection()) {\n DatabaseMetaData metaData = connection.getMetaData();\n assertEquals(metaData.getDatabaseProductName(), \"Presto\");\n a... | {
"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 String getDatabaseProductVersion()\n throws SQLException\n {\n return connection.getServerInfo().getNodeVersion().getVersion();\n }",
"class_method_signature": "PrestoDatabaseMetaData.getDatabaseProductVersion()",
"constructor": false,
"full_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_1189 | {
"fields": [
{
"declarator": "TASK_INSTANCE_ID = \"task-instance-id\"",
"modifier": "private static final",
"original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";",
"type": "String",
"var_name": "TASK_INSTANCE_ID"
},
{
"declarator": "T... | {
"body": "@Test\n public void testInvalidTokenFails()\n {\n ClientBuffer buffer = new ClientBuffer(TASK_INSTANCE_ID, BUFFER_ID);\n addPage(buffer, createPage(0));\n addPage(buffer, createPage(1));\n buffer.getPages(1, sizeOfPages(10)).cancel(true);\n assertBufferInfo(buffer, ... | {
"fields": [
{
"declarator": "taskInstanceId",
"modifier": "private final",
"original_string": "private final String taskInstanceId;",
"type": "String",
"var_name": "taskInstanceId"
},
{
"declarator": "bufferId",
"modifier": "private final",
"original_strin... | {
"body": "public ListenableFuture<BufferResult> getPages(long sequenceId, DataSize maxSize)\n {\n return getPages(sequenceId, maxSize, Optional.empty());\n }",
"class_method_signature": "ClientBuffer.getPages(long sequenceId, DataSize maxSize)",
"constructor": false,
"full_signature": "public List... | {
"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_1023 | {
"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 testOrderByWithWildcard()\n {\n // TODO: validate output\n analyze(\"SELECT t1.* FROM t1 ORDER BY a\");\n }",
"class_method_signature": "TestAnalyzer.testOrderByWithWildcard()",
"constructor": false,
"full_signature": "@Test public void testOrderByWithWildca... | {
"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_8 | {
"fields": [],
"file": "presto-client/src/test/java/io/prestosql/client/TestIntervalDayTime.java",
"identifier": "TestIntervalDayTime",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testOverflow()\n {\n long days = (Long.MAX_VALUE / DAYS.toMillis(1)) + 1;\n toMillis(days, 0, 0, 0, 0);\n }",
"class_method_signature": "TestIntervalDayTime.testOverflow()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "MILLIS_IN_SECOND = 1000",
"modifier": "private static final",
"original_string": "private static final long MILLIS_IN_SECOND = 1000;",
"type": "long",
"var_name": "MILLIS_IN_SECOND"
},
{
"declarator": "MILLIS_IN_MINUTE = 60 * MILLIS_IN_SEC... | {
"body": "public static long toMillis(long day, long hour, long minute, long second, long millis)\n {\n try {\n long value = millis;\n value = addExact(value, multiplyExact(day, MILLIS_IN_DAY));\n value = addExact(value, multiplyExact(hour, MILLIS_IN_HOUR));\n va... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_440 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestDecimals.java",
"identifier": "TestDecimals",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseIncludeLeadingZerosInPrecision()\n {\n assertParseResultIncludeLeadingZerosInPrecision(\"0\", 0L, 1, 0);\n assertParseResultIncludeLeadingZerosInPrecision(\"+0\", 0L, 1, 0);\n assertParseResultIncludeLeadingZerosInPrecision(\"-0\", 0L, 1, 0);\n ... | {
"fields": [
{
"declarator": "MAX_PRECISION = 38",
"modifier": "public static final",
"original_string": "public static final int MAX_PRECISION = 38;",
"type": "int",
"var_name": "MAX_PRECISION"
},
{
"declarator": "MAX_SHORT_PRECISION = 18",
"modifier": "public s... | {
"body": "public static DecimalParseResult parseIncludeLeadingZerosInPrecision(String stringValue)\n {\n return parse(stringValue, true);\n }",
"class_method_signature": "Decimals.parseIncludeLeadingZerosInPrecision(String stringValue)",
"constructor": false,
"full_signature": "public static Decim... | {
"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_913 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMoreRequiredGroupsThanActual()\n {\n List<LocalProperty<String>> actual = builder()\n .constant(\"b\")\n .grouped(\"a\")\n .grouped(\"d\")\n .build();\n\n assertMatch(\n actual,\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_856 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCodepoint()\n {\n assertFunction(\"CODEPOINT('x')\", INTEGER, 0x78);\n assertFunction(\"CODEPOINT('\\u840C')\", INTEGER, 0x840C);\n\n assertFunction(\"CODEPOINT(CHR(128077))\", INTEGER, 128077);\n assertFunction(\"CODEPOINT(CHR(33804))\", INTEGER, 3... | {
"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(\"Returns Unicode code point of a single character string\")\n @ScalarFunction(\"codepoint\")\n @SqlType(StandardTypes.INTEGER)\n public static long codepoint(@SqlType(\"varchar(1)\") Slice slice)\n {\n checkCondition(countCodePoints(slice) == 1, INVALID_FUNCTION_ARGUMENT, \... | {
"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_23 | {
"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 testTableRulesForCheckCanSelectFromColumns()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanSelectFromColumns(ALICE, new CatalogSchemaTableName(\"some-catalog\", \"test\", ... | {
"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 checkCanSelectFromColumns(SystemSecurityContext context, CatalogSchemaTableName table, Set<String> columns)\n {\n if (!checkTablePermission(context, table, SELECT)) {\n denySelectTable(table.toString());\n }\n }",
"class_method_signature": "FileBa... | {
"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_155 | {
"fields": [
{
"declarator": "tempRoot",
"modifier": "private",
"original_string": "private File tempRoot;",
"type": "File",
"var_name": "tempRoot"
},
{
"declarator": "tempFile",
"modifier": "private",
"original_string": "private Path tempFile;",
"typ... | {
"body": "@Test(expectedExceptions = IOException.class, expectedExceptionsMessageRegExp = \"Incorrect file size \\\\(.*\\\\) for file \\\\(end of stream not reached\\\\): file:.*\")\n public void testReadTailNoEndOfFileFound()\n throws Exception\n {\n byte[] contents = countingTestFileContent... | {
"fields": [
{
"declarator": "MAX_SUPPORTED_PADDING_BYTES = 64",
"modifier": "public static final",
"original_string": "public static final int MAX_SUPPORTED_PADDING_BYTES = 64;",
"type": "int",
"var_name": "MAX_SUPPORTED_PADDING_BYTES"
},
{
"declarator": "MAXIMUM_READ... | {
"body": "public static FSDataInputStreamTail readTail(String path, long paddedFileSize, FSDataInputStream inputStream, int length)\n throws IOException\n {\n checkArgument(length >= 0, \"length is negative: %s\", length);\n checkArgument(length <= MAXIMUM_READ_LENGTH, \"length (%s) excee... | {
"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_505 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/TestPrestoException.java",
"identifier": "TestPrestoException",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMessage()\n {\n PrestoException exception = new PrestoException(new TestErrorCode(), \"test\");\n assertEquals(exception.getMessage(), \"test\");\n\n exception = new PrestoException(new TestErrorCode(), new RuntimeException(\"test2\"));\n assertEqua... | {
"fields": [
{
"declarator": "errorCode",
"modifier": "private final",
"original_string": "private final ErrorCode errorCode;",
"type": "ErrorCode",
"var_name": "errorCode"
},
{
"declarator": "location",
"modifier": "private final",
"original_string": "priv... | {
"body": "@Override\n public String getMessage()\n {\n String message = getRawMessage();\n if (location.isPresent()) {\n message = format(\"line %s:%s: %s\", location.get().getLineNumber(), location.get().getColumnNumber(), message);\n }\n return message;\n }",
"clas... | {
"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.