id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
166515022_484 | {
"fields": [
{
"declarator": "A = new TestingColumnHandle(\"a\")",
"modifier": "private static final",
"original_string": "private static final ColumnHandle A = new TestingColumnHandle(\"a\");",
"type": "ColumnHandle",
"var_name": "A"
},
{
"declarator": "B = new Testin... | {
"body": "@Test\n public void testContains()\n {\n assertTrue(contains(\n ImmutableMap.of(),\n ImmutableMap.of()));\n\n assertTrue(contains(\n ImmutableMap.of(),\n ImmutableMap.of(A, Domain.none(BIGINT))));\n\n assertTrue(contains... | {
"fields": [
{
"declarator": "NONE = new TupleDomain<>(Optional.empty())",
"modifier": "private static final",
"original_string": "private static final TupleDomain<?> NONE = new TupleDomain<>(Optional.empty());",
"type": "TupleDomain<?>",
"var_name": "NONE"
},
{
"decla... | {
"body": "public boolean contains(TupleDomain<T> other)\n {\n return other.isNone() || columnWiseUnion(this, other).equals(this);\n }",
"class_method_signature": "TupleDomain.contains(TupleDomain<T> other)",
"constructor": false,
"full_signature": "public boolean contains(TupleDomain<T> other)",
... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_191 | {
"fields": [
{
"declarator": "forReal",
"modifier": "private",
"original_string": "private boolean forReal;",
"type": "boolean",
"var_name": "forReal"
},
{
"declarator": "successResponse = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><soapenv:Envelope xmlns:soap... | {
"body": "@Test\n public void createAuthenticatedPrincipalSuccess()\n throws InterruptedException\n {\n String org = \"my18CharOrgId\"; // As if from salesforce.allowed-organizations property.\n String username = \"user@salesforce.com\";\n String password = \"passtoken\";\n\n ... | {
"fields": [
{
"declarator": "log = Logger.get(SalesforceBasicAuthenticator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(SalesforceBasicAuthenticator.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@Override\n public Principal createAuthenticatedPrincipal(String username, String password)\n {\n try {\n return userCache.getUnchecked(new Credential(username, password));\n }\n catch (UncheckedExecutionException e) {\n throwIfInstanceOf(e.getCause(), Acces... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_892 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestColorFunctions.java",
"identifier": "TestColorFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testColor()\n {\n assertEquals(color(toSlice(\"black\")), -1);\n assertEquals(color(toSlice(\"red\")), -2);\n assertEquals(color(toSlice(\"green\")), -3);\n assertEquals(color(toSlice(\"yellow\")), -4);\n assertEquals(color(toSlice(\"blue\")), -5... | {
"fields": [
{
"declarator": "ANSI_RESET = \"\\u001b[0m\"",
"modifier": "private static final",
"original_string": "private static final String ANSI_RESET = \"\\u001b[0m\";",
"type": "String",
"var_name": "ANSI_RESET"
},
{
"declarator": "RENDERED_TRUE = render(utf8Slic... | {
"body": "@ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(ColorType.NAME)\n public static long color(@SqlType(\"varchar(x)\") Slice color)\n {\n int rgb = parseRgb(color);\n\n if (rgb != -1) {\n return rgb;\n }\n\n // encode system colors (0-15) as negative v... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_938 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/TestSchedulingOrderVisitor.java",
"identifier": "TestSchedulingOrderVisitor",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSemiJoinOrder()\n {\n PlanBuilder planBuilder = new PlanBuilder(new PlanNodeIdAllocator(), dummyMetadata());\n Symbol sourceJoin = planBuilder.symbol(\"sourceJoin\");\n TableScanNode a = planBuilder.tableScan(ImmutableList.of(sourceJoin), ImmutableMap.of(s... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/SchedulingOrderVisitor.java",
"identifier": "SchedulingOrderVisitor",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchedulingOrderVisitor.scheduleOrder(PlanNode root)",
"constructor": false,
"full_... | {
"body": "public static List<PlanNodeId> scheduleOrder(PlanNode root)\n {\n ImmutableList.Builder<PlanNodeId> schedulingOrder = ImmutableList.builder();\n root.accept(new Visitor(schedulingOrder::add), null);\n return schedulingOrder.build();\n }",
"class_method_signature": "SchedulingOr... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_312 | {
"fields": [
{
"declarator": "TOLERANCE = 0.01",
"modifier": "private static final",
"original_string": "private static final double TOLERANCE = 0.01;",
"type": "double",
"var_name": "TOLERANCE"
},
{
"declarator": "SUPPORTED_SCHEMAS = ImmutableList.of(\"tiny\", \"sf1\"... | {
"body": "@Test\n public void testColumnStatsWithConstraints()\n {\n SUPPORTED_SCHEMAS.forEach(schema -> {\n double scaleFactor = TpchMetadata.schemaNameToScaleFactor(schema);\n\n //value count, min and max are supported for the constrained column\n testColumnStats(schem... | {
"fields": [
{
"declarator": "TINY_SCHEMA_NAME = \"tiny\"",
"modifier": "public static final",
"original_string": "public static final String TINY_SCHEMA_NAME = \"tiny\";",
"type": "String",
"var_name": "TINY_SCHEMA_NAME"
},
{
"declarator": "TINY_SCALE_FACTOR = 0.01",
... | {
"body": "public static double schemaNameToScaleFactor(String schemaName)\n {\n if (TINY_SCHEMA_NAME.equals(schemaName)) {\n return TINY_SCALE_FACTOR;\n }\n\n if (!schemaName.startsWith(\"sf\")) {\n return -1;\n }\n\n try {\n return Double.parseD... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_742 | {
"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 testCombineUnderflow()\n {\n addToState(state, TWO.pow(125).negate());\n addToState(state, TWO.pow(126).negate());\n\n LongDecimalWithOverflowState otherState = new LongDecimalWithOverflowStateFactory().createSingleState();\n\n addToState(otherState, TW... | {
"fields": [
{
"declarator": "DECIMAL_SUM_AGGREGATION = new DecimalSumAggregation()",
"modifier": "public static final",
"original_string": "public static final DecimalSumAggregation DECIMAL_SUM_AGGREGATION = new DecimalSumAggregation();",
"type": "DecimalSumAggregation",
"var_name"... | {
"body": "public static void combine(LongDecimalWithOverflowState state, LongDecimalWithOverflowState otherState)\n {\n state.setOverflow(state.getOverflow() + otherState.getOverflow());\n\n if (state.getLongDecimal() == null) {\n state.setLongDecimal(otherState.getLongDecimal());\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_1008 | {
"fields": [
{
"declarator": "METADATA = createTestMetadataManager()",
"modifier": "private static final",
"original_string": "private static final Metadata METADATA = createTestMetadataManager();",
"type": "Metadata",
"var_name": "METADATA"
},
{
"declarator": "ADD_10_... | {
"body": "@Test\n public void testGeneratedClassName()\n {\n PageFunctionCompiler functionCompiler = new PageFunctionCompiler(METADATA, 0);\n\n String planNodeId = \"7\";\n String stageId = \"20170707_223500_67496_zguwn.2\";\n String classSuffix = stageId + \"_\" + planNodeId;\n ... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private final",
"original_string": "private final Metadata metadata;",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "determinismEvaluator",
"modifier": "private final",
"original_string"... | {
"body": "public Supplier<PageProjection> compileProjection(RowExpression projection, Optional<String> classNameSuffix)\n {\n if (projectionCache == null) {\n return compileProjectionInternal(projection, classNameSuffix);\n }\n return projectionCache.getUnchecked(projection);\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_257 | {
"fields": [
{
"declarator": "MAX_SHARD_ROWS = 100",
"modifier": "private static final",
"original_string": "private static final long MAX_SHARD_ROWS = 100;",
"type": "long",
"var_name": "MAX_SHARD_ROWS"
},
{
"declarator": "MAX_SHARD_SIZE = DataSize.ofBytes(100)",
... | {
"body": "@Test\n public void testTemporalCompactionSpanningDays()\n {\n long day1 = Duration.ofDays(Duration.ofNanos(System.nanoTime()).toDays()).toMillis();\n long day2 = Duration.ofDays(Duration.ofMillis(day1).toDays() + 1).toMillis();\n long day3 = Duration.ofDays(Duration.ofMillis(day... | {
"fields": [
{
"declarator": "maxShardSize",
"modifier": "private final",
"original_string": "private final DataSize maxShardSize;",
"type": "DataSize",
"var_name": "maxShardSize"
},
{
"declarator": "maxShardRows",
"modifier": "private final",
"original_str... | {
"body": "public Set<OrganizationSet> createCompactionSets(Table tableInfo, Collection<ShardIndexInfo> shards)\n {\n Collection<Collection<ShardIndexInfo>> shardsByDaysBuckets = getShardsByDaysBuckets(tableInfo, shards);\n\n ImmutableSet.Builder<OrganizationSet> compactionSets = ImmutableSet.builder... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_607 | {
"fields": [],
"file": "presto-teradata-functions/src/test/java/io/prestosql/teradata/functions/dateformat/TestDateFormatParser.java",
"identifier": "TestDateFormatParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTokenize()\n {\n assertEquals(\n DateFormatParser.tokenize(\"yyyy mm\").stream().map(Token::getType).collect(Collectors.toList()),\n asList(DateFormat.YYYY, DateFormat.TEXT, DateFormat.MM));\n }",
"class_method_signature": "TestDateFor... | {
"fields": [],
"file": "presto-teradata-functions/src/main/java/io/prestosql/teradata/functions/dateformat/DateFormatParser.java",
"identifier": "DateFormatParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "DateFormatParser.DateFormatParser()",
"constructor": true,
"fu... | {
"body": "public static List<? extends Token> tokenize(String format)\n {\n DateFormat lexer = new io.prestosql.teradata.functions.DateFormat(new ANTLRInputStream(format));\n return lexer.getAllTokens();\n }",
"class_method_signature": "DateFormatParser.tokenize(String format)",
"constructor"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_492 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestDomain.java",
"identifier": "TestDomain",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testContains()\n {\n assertTrue(Domain.all(BIGINT).contains(Domain.all(BIGINT)));\n assertTrue(Domain.all(BIGINT).contains(Domain.none(BIGINT)));\n assertTrue(Domain.all(BIGINT).contains(Domain.notNull(BIGINT)));\n assertTrue(Domain.all(BIGINT).contains... | {
"fields": [
{
"declarator": "DEFAULT_COMPACTION_THRESHOLD = 32",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_COMPACTION_THRESHOLD = 32;",
"type": "int",
"var_name": "DEFAULT_COMPACTION_THRESHOLD"
},
{
"declarator": "values",
... | {
"body": "public boolean contains(Domain other)\n {\n checkCompatibility(other);\n return this.union(other).equals(this);\n }",
"class_method_signature": "Domain.contains(Domain other)",
"constructor": false,
"full_signature": "public boolean contains(Domain other)",
"identifier": "contai... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_168 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveWriterFactory.java",
"identifier": "TestHiveWriterFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComputeBucketedFileName()\n {\n String name = computeBucketedFileName(Optional.of(\"20180102_030405_00641_x1y2z\"), 1234);\n assertEquals(name, \"001234_0_20180102_030405_00641_x1y2z\");\n assertEquals(getBucketIdFromFile(name), 1234);\n\n name = co... | {
"fields": [
{
"declarator": "MAX_BUCKET_COUNT = 100_000",
"modifier": "private static final",
"original_string": "private static final int MAX_BUCKET_COUNT = 100_000;",
"type": "int",
"var_name": "MAX_BUCKET_COUNT"
},
{
"declarator": "BUCKET_NUMBER_PADDING = Integer.t... | {
"body": "public static String computeBucketedFileName(Optional<String> queryId, int bucket)\n {\n String paddedBucket = Strings.padStart(Integer.toString(bucket), BUCKET_NUMBER_PADDING, '0');\n if (queryId.isPresent()) {\n return format(\"0%s_0_%s\", paddedBucket, queryId.get());\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_538 | {
"fields": [],
"file": "presto-resource-group-managers/src/test/java/io/prestosql/plugin/resourcegroups/TestFileResourceGroupConfig.java",
"identifier": "TestFileResourceGroupConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(FileResourceGroupConfig.class)\n .setConfigFile(null));\n }",
"class_method_signature": "TestFileResourceGroupConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "configFile",
"modifier": "private",
"original_string": "private String configFile;",
"type": "String",
"var_name": "configFile"
}
],
"file": "presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/FileResourceGroupConfig... | {
"body": "@Config(\"resource-groups.config-file\")\n public FileResourceGroupConfig setConfigFile(String configFile)\n {\n this.configFile = configFile;\n return this;\n }",
"class_method_signature": "FileResourceGroupConfig.setConfigFile(String configFile)",
"constructor": false,
"full_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1272 | {
"fields": [],
"file": "presto-parquet/src/test/java/io/prestosql/parquet/predicate/TestPredicateUtils.java",
"identifier": "TestPredicateUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsStatisticsOverflow()\n {\n assertFalse(isStatisticsOverflow(TINYINT, new ParquetIntegerStatistics(-10L, 10L)));\n assertTrue(isStatisticsOverflow(TINYINT, new ParquetIntegerStatistics(-129L, 10L)));\n assertTrue(isStatisticsOverflow(TINYINT, new ParquetI... | {
"fields": [],
"file": "presto-parquet/src/main/java/io/prestosql/parquet/predicate/PredicateUtils.java",
"identifier": "PredicateUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PredicateUtils.PredicateUtils()",
"constructor": true,
"full_signature": "private Predic... | {
"body": "public static boolean isStatisticsOverflow(Type type, ParquetIntegerStatistics parquetIntegerStatistics)\n {\n long min = parquetIntegerStatistics.getMin();\n long max = parquetIntegerStatistics.getMax();\n\n if (type == TINYINT) {\n return min < Byte.MIN_VALUE || max > B... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_884 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestLuhnCheckFunction.java",
"identifier": "TestLuhnCheckFunction",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testLuhnCheck()\n {\n assertFunction(\"luhn_check('4242424242424242')\", BOOLEAN, true);\n assertFunction(\"luhn_check('1234567891234567')\", BOOLEAN, false);\n assertFunction(\"luhn_check('')\", BOOLEAN, false);\n assertFunction(\"luhn_check(NULL)\", B... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/LuhnCheckFunction.java",
"identifier": "LuhnCheckFunction",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuhnCheckFunction.LuhnCheckFunction()",
"constructor": true,
"full_signature": "private ... | {
"body": "@Description(\"Checks that a string of digits is valid according to the Luhn algorithm\")\n @ScalarFunction(\"luhn_check\")\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean LuhnCheck(@SqlType(StandardTypes.VARCHAR) Slice slice)\n {\n if (slice.length() == 0) {\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_187 | {
"fields": [
{
"declarator": "TEST_COLUMN_NAME = \"col\"",
"modifier": "private static final",
"original_string": "private static final String TEST_COLUMN_NAME = \"col\";",
"type": "String",
"var_name": "TEST_COLUMN_NAME"
},
{
"declarator": "TEST_COLUMN_TYPE = ROWTYPE_... | {
"body": "@Test\n public void testAdaptPage()\n {\n List<HiveColumnHandle> columns = ImmutableList.of(\n createProjectedColumnHandle(TEST_FULL_COLUMNS.get(\"col\"), ImmutableList.of(0, 0)),\n createProjectedColumnHandle(TEST_FULL_COLUMNS.get(\"col\"), ImmutableList.of(0)));... | {
"fields": [
{
"declarator": "outputToInputMapping",
"modifier": "private final",
"original_string": "private final List<ChannelMapping> outputToInputMapping;",
"type": "List<ChannelMapping>",
"var_name": "outputToInputMapping"
},
{
"declarator": "outputTypes",
"... | {
"body": "public Page adaptPage(Page input)\n {\n if (input == null) {\n return null;\n }\n\n Block[] blocks = new Block[outputToInputMapping.size()];\n\n // Prepare adaptations to extract dereferences\n for (int i = 0; i < outputToInputMapping.size(); i++) {\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_754 | {
"fields": [
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "scheduledExecutor",
"modifier": "private",
"original_string": "priv... | {
"body": "@Test\n public void test()\n {\n List<Page> input = rowPagesBuilder(VARCHAR, BIGINT)\n .addSequencePage(100, 0, 0)\n .build();\n\n Metadata metadata = createTestMetadataManager();\n RowExpression filter = call(\n metadata.resolveOperat... | {
"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/FilterAndProjectOperator.java",
... | {
"body": "public static OperatorFactory createOperatorFactory(\n int operatorId,\n PlanNodeId planNodeId,\n Supplier<PageProcessor> processor,\n List<Type> types,\n DataSize minOutputPageSize,\n int minOutputPageRowCount)\n {\n return create... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_304 | {
"fields": [
{
"declarator": "RUNTIME_OBJECT = \"java.lang:type=Runtime\"",
"modifier": "private static final",
"original_string": "private static final String RUNTIME_OBJECT = \"java.lang:type=Runtime\";",
"type": "String",
"var_name": "RUNTIME_OBJECT"
},
{
"declarato... | {
"body": "@Test\n public void testGetTableHandle()\n {\n JmxTableHandle handle = metadata.getTableHandle(SESSION, RUNTIME_TABLE);\n assertEquals(handle.getObjectNames(), ImmutableList.of(RUNTIME_OBJECT));\n\n List<JmxColumnHandle> columns = handle.getColumnHandles();\n assertTrue(co... | {
"fields": [
{
"declarator": "LOGGER = Logger.get(JmxMetadata.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.get(JmxMetadata.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JMX_SCHEMA_NA... | {
"body": "@Override\n public JmxTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)\n {\n return getTableHandle(tableName);\n }",
"class_method_signature": "JmxMetadata.getTableHandle(ConnectorSession session, SchemaTableName tableName)",
"constructor": false,
"full_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_611 | {
"fields": [],
"file": "presto-teradata-functions/src/test/java/io/prestosql/teradata/functions/dateformat/TestDateFormatParser.java",
"identifier": "TestDateFormatParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = PrestoException.class)\n public void testInvalidTokenCreate2()\n {\n DateFormatParser.createDateTimeFormatter(\"yyym/mm/dd\");\n }",
"class_method_signature": "TestDateFormatParser.testInvalidTokenCreate2()",
"constructor": false,
"full_signature": "@Test(ex... | {
"fields": [],
"file": "presto-teradata-functions/src/main/java/io/prestosql/teradata/functions/dateformat/DateFormatParser.java",
"identifier": "DateFormatParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "DateFormatParser.DateFormatParser()",
"constructor": true,
"fu... | {
"body": "public static DateTimeFormatter createDateTimeFormatter(String format)\n {\n DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();\n for (Token token : tokenize(format)) {\n switch (token.getType()) {\n case DateFormat.TEXT:\n build... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_241 | {
"fields": [
{
"declarator": "temporary",
"modifier": "private",
"original_string": "private File temporary;",
"type": "File",
"var_name": "temporary"
},
{
"declarator": "store",
"modifier": "private",
"original_string": "private FileStorageService store;",... | {
"body": "@Test\n public void testGetStorageShards()\n throws Exception\n {\n Set<UUID> shards = ImmutableSet.<UUID>builder()\n .add(UUID.fromString(\"9e7abb51-56b5-4180-9164-ad08ddfe7c63\"))\n .add(UUID.fromString(\"bbfc3895-1c3d-4bf4-bca4-7b1198b1759e\"))\n ... | {
"fields": [
{
"declarator": "log = Logger.get(FileStorageService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(FileStorageService.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "HEX_DIRE... | {
"body": "@Override\n public Set<UUID> getStorageShards()\n {\n ImmutableSet.Builder<UUID> shards = ImmutableSet.builder();\n for (File level1 : listFiles(baseStorageDir, FileStorageService::isHexDirectory)) {\n for (File level2 : listFiles(level1, FileStorageService::isHexDirectory)) ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_996 | {
"fields": [
{
"declarator": "A = new Symbol(\"a\")",
"modifier": "private static final",
"original_string": "private static final Symbol A = new Symbol(\"a\");",
"type": "Symbol",
"var_name": "A"
},
{
"declarator": "B = new Symbol(\"b\")",
"modifier": "private s... | {
"body": "@Test\n public void testLeftJoinWithFalseInner()\n {\n List<JoinNode.EquiJoinClause> criteria = ImmutableList.of(new JoinNode.EquiJoinClause(A, D));\n\n Map<Symbol, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C)));\n Table... | {
"fields": [
{
"declarator": "SYMBOL_MATCHES_EXPRESSION =\n entry -> entry.getValue().equals(entry.getKey().toSymbolReference())",
"modifier": "private static final",
"original_string": "private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION... | {
"body": "public Expression extract(Session session, PlanNode node, TypeProvider types, TypeAnalyzer typeAnalyzer)\n {\n return node.accept(new Visitor(domainTranslator, metadata, session, types, typeAnalyzer, useTableProperties), null);\n }",
"class_method_signature": "EffectivePredicateExtractor.ext... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_49 | {
"fields": [
{
"declarator": "ADMIN = user(\"admin\", ImmutableSet.of(\"admin\", \"staff\"))",
"modifier": "private static final",
"original_string": "private static final ConnectorSecurityContext ADMIN = user(\"admin\", ImmutableSet.of(\"admin\", \"staff\"));",
"type": "ConnectorSecurity... | {
"body": "@Test\n public void testFilterSchemas()\n {\n ConnectorAccessControl accessControl = createAccessControl(\"visibility.json\");\n\n ImmutableSet<String> allSchemas = ImmutableSet.of(\"specific-schema\", \"alice-schema\", \"bob-schema\", \"unknown\");\n assertEquals(accessControl.f... | {
"fields": [
{
"declarator": "INFORMATION_SCHEMA_NAME = \"information_schema\"",
"modifier": "private static final",
"original_string": "private static final String INFORMATION_SCHEMA_NAME = \"information_schema\";",
"type": "String",
"var_name": "INFORMATION_SCHEMA_NAME"
},
... | {
"body": "@Override\n public Set<String> filterSchemas(ConnectorSecurityContext context, Set<String> schemaNames)\n {\n return schemaNames.stream()\n .filter(schemaName -> checkAnySchemaAccess(context, schemaName))\n .collect(toImmutableSet());\n }",
"class_method_sign... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1225 | {
"fields": [
{
"declarator": "topologyFile",
"modifier": "private",
"original_string": "private File topologyFile;",
"type": "File",
"var_name": "topologyFile"
},
{
"declarator": "topologyNewFile",
"modifier": "private",
"original_string": "private File top... | {
"body": "@Test\n public void testLocate()\n {\n NetworkTopology topology = new FileBasedNetworkTopology(topologyFile, Duration.valueOf(\"1d\"), new TestingTicker());\n\n assertEquals(topology.locate(HostAddress.fromString(\"0.0.0.0\")), new NetworkLocation());\n assertEquals(topology.loca... | {
"fields": [
{
"declarator": "log = Logger.get(FileBasedNetworkTopology.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(FileBasedNetworkTopology.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n public NetworkLocation locate(HostAddress address)\n {\n return getTopology().getOrDefault(address.getHostText(), ROOT_LOCATION);\n }",
"class_method_signature": "FileBasedNetworkTopology.locate(HostAddress address)",
"constructor": false,
"full_signature": "@Override publ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_580 | {
"fields": [
{
"declarator": "database",
"modifier": "private",
"original_string": "private TestingDatabase database;",
"type": "TestingDatabase",
"var_name": "database"
},
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private JdbcM... | {
"body": "@Test\n public void getTableMetadata()\n {\n // known table\n ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(SESSION, tableHandle);\n assertEquals(tableMetadata.getTable(), new SchemaTableName(\"example\", \"numbers\"));\n assertEquals(tableMetadata.getCo... | {
"fields": [
{
"declarator": "SYNTHETIC_COLUMN_NAME_PREFIX = \"_presto_generated_\"",
"modifier": "private static final",
"original_string": "private static final String SYNTHETIC_COLUMN_NAME_PREFIX = \"_presto_generated_\";",
"type": "String",
"var_name": "SYNTHETIC_COLUMN_NAME_PRE... | {
"body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table)\n {\n JdbcTableHandle handle = (JdbcTableHandle) table;\n\n ImmutableList.Builder<ColumnMetadata> columnMetadata = ImmutableList.builder();\n for (JdbcColumnHandle col... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_979 | {
"fields": [
{
"declarator": "TEST_SESSION = testSessionBuilder()\n .setTransactionId(TransactionId.create())\n .build()",
"modifier": "private static final",
"original_string": "private static final Session TEST_SESSION = testSessionBuilder()\n .setTransactionI... | {
"body": "@Test\n public void testPartialTranslator()\n {\n Expression rowSymbolReference = new SymbolReference(\"row_symbol_1\");\n Expression dereferenceExpression1 = new DereferenceExpression(rowSymbolReference, new Identifier(\"int_symbol_1\"));\n Expression dereferenceExpression2 = ne... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/PartialTranslator.java",
"identifier": "PartialTranslator",
"interfaces": "",
"methods": [
{
"class_method_signature": "PartialTranslator.PartialTranslator()",
"constructor": true,
"full_signature": "private Par... | {
"body": "private PartialTranslator() {}",
"class_method_signature": "PartialTranslator.PartialTranslator()",
"constructor": true,
"full_signature": "private PartialTranslator()",
"identifier": "PartialTranslator",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signa... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_353 | {
"fields": [
{
"declarator": "ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\")",
"modifier": "private static final",
"original_string": "private static final DateTimeZone ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\");",
"type": "DateTimeZone",
"var_name": "ASIA_ORAL_ZONE"
... | {
"body": "@Test\n public void testGetDriverVersion()\n throws Exception\n {\n Driver driver = DriverManager.getDriver(\"jdbc:presto:\");\n assertEquals(driver.getMajorVersion(), 0);\n assertEquals(driver.getMajorVersion(), 0);\n\n try (Connection connection = createConnec... | {
"fields": [
{
"declarator": "DRIVER_NAME = \"Presto JDBC Driver\"",
"modifier": "static final",
"original_string": "static final String DRIVER_NAME = \"Presto JDBC Driver\";",
"type": "String",
"var_name": "DRIVER_NAME"
},
{
"declarator": "DRIVER_VERSION",
"modi... | {
"body": "@Override\n public int getMajorVersion()\n {\n return DRIVER_VERSION_MAJOR;\n }",
"class_method_signature": "PrestoDriver.getMajorVersion()",
"constructor": false,
"full_signature": "@Override public int getMajorVersion()",
"identifier": "getMajorVersion",
"invocations": [],
"mo... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_703 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestRealOperators.java",
"identifier": "TestRealOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToDouble()\n {\n assertFunction(\"CAST(REAL'754.1985' AS DOUBLE)\", DOUBLE, (double) 754.1985f);\n assertFunction(\"CAST(REAL'-754.2008' AS DOUBLE)\", DOUBLE, (double) -754.2008f);\n assertFunction(\"CAST(REAL'0.0' AS DOUBLE)\", DOUBLE, (double) 0.0f);... | {
"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(CAST)\n @SqlType(StandardTypes.DOUBLE)\n public static double castToDouble(@SqlType(StandardTypes.REAL) long value)\n {\n return (double) intBitsToFloat((int) value);\n }",
"class_method_signature": "RealOperators.castToDouble(@SqlType(StandardTypes.REAL) long value)",
... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1049 | {
"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 testSingleGroupingSet()\n {\n // TODO: validate output\n analyze(\"SELECT SUM(b) FROM t1 GROUP BY ()\");\n analyze(\"SELECT SUM(b) FROM t1 GROUP BY GROUPING SETS (())\");\n analyze(\"SELECT a, SUM(b) FROM t1 GROUP BY GROUPING SETS (a)\");\n analy... | {
"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_216 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/backup/TestFileBackupConfig.java",
"identifier": "TestFileBackupConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"backup.directory\", \"/backup\")\n .build();\n\n FileBackupConfig expected = new FileBackupConfig()\n ... | {
"fields": [
{
"declarator": "backupDirectory",
"modifier": "private",
"original_string": "private File backupDirectory;",
"type": "File",
"var_name": "backupDirectory"
}
],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/backup/FileBackupConfig... | {
"body": "@Config(\"backup.directory\")\n @ConfigDescription(\"Base directory to use for the backup copy of shard data\")\n public FileBackupConfig setBackupDirectory(File backupDirectory)\n {\n this.backupDirectory = backupDirectory;\n return this;\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_646 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestBigintOperators.java",
"identifier": "TestBigintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testDivide()\n {\n assertFunction(\"100000000037 / 37\", BIGINT, 100000000037L / 37L);\n assertFunction(\"37 / 100000000017\", BIGINT, 37 / 100000000017L);\n assertFunction(\"100000000017 / 37\", BIGINT, 100000000017L / 37L);\n assertFunction(\"10000000... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/BigintOperators.java",
"identifier": "BigintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "BigintOperators.BigintOperators()",
"constructor": true,
"full_signature": "private BigintOperators()"... | {
"body": "@ScalarOperator(DIVIDE)\n @SqlType(StandardTypes.BIGINT)\n public static long divide(@SqlType(StandardTypes.BIGINT) long left, @SqlType(StandardTypes.BIGINT) long right)\n {\n try {\n if (left == Long.MIN_VALUE && right == -1) {\n throw new PrestoException(NUMERIC_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_451 | {
"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 testShiftRight()\n {\n assertShiftRight(unscaledDecimal(0), 0, true, unscaledDecimal(0));\n assertShiftRight(unscaledDecimal(0), 33, true, unscaledDecimal(0));\n\n assertShiftRight(unscaledDecimal(1), 1, true, unscaledDecimal(1));\n assertShiftRight(uns... | {
"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": "static void shiftRight(Slice decimal, int rightShifts, boolean roundUp, Slice result)\n {\n if (rightShifts == 0) {\n copyUnscaledDecimal(decimal, result);\n return;\n }\n\n int wordShifts = rightShifts / 64;\n int bitShiftsInWord = rightShifts % 64;\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_902 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNormalizeComplexWithMiddleConstant()\n {\n List<LocalProperty<String>> localProperties = builder()\n .sorted(\"a\", SortOrder.ASC_NULLS_FIRST)\n .grouped(\"a\", \"b\")\n .grouped(\"c\")\n .constant(\"a\")\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_847 | {
"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 testBetaCdf()\n {\n assertFunction(\"beta_cdf(3, 3.6, 0.0)\", DOUBLE, 0.0);\n assertFunction(\"beta_cdf(3, 3.6, 1.0)\", DOUBLE, 1.0);\n assertFunction(\"beta_cdf(3, 3.6, 0.3)\", DOUBLE, 0.21764809997679938);\n assertFunction(\"beta_cdf(3, 3.6, 0.9)\", D... | {
"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(\"Beta cdf given the a, b parameters and value\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double betaCdf(\n @SqlType(StandardTypes.DOUBLE) double a,\n @SqlType(StandardTypes.DOUBLE) double b,\n @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_32 | {
"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 testTableRulesForCheckCanGrantTablePrivilege()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanGrantTablePrivilege(ADMIN, Privilege.DELETE, new CatalogSchemaTableName(\"some... | {
"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 checkCanGrantTablePrivilege(SystemSecurityContext context, Privilege privilege, CatalogSchemaTableName table, PrestoPrincipal grantee, boolean grantOption)\n {\n if (!checkTablePermission(context, table, OWNERSHIP)) {\n denyGrantTablePrivilege(privilege.name(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_514 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestClientOptions.java",
"identifier": "TestClientOptions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testServerHttpUri()\n {\n Console console = createConsole(\"--server=http://test/foo\");\n ClientSession session = console.clientOptions.toClientSession();\n assertEquals(session.getServer().toString(), \"http://test/foo\");\n }",
"class_method_signature"... | {
"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_144 | {
"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 testGetTableStatistics()\n {\n String partitionName = \"p1=string1/p2=1234\";\n PartitionStatistics statistics = PartitionStatistics.builder()\n .setBasicStatistics(new HiveBasicStatistics(OptionalLong.empty(), OptionalLong.of(1000), OptionalLong.empty... | {
"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": "@Override\n public TableStatistics getTableStatistics(\n ConnectorSession session,\n SchemaTableName table,\n Map<String, ColumnHandle> columns,\n Map<String, Type> columnTypes,\n List<HivePartition> partitions)\n {\n if (!isStatisticsEnab... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1177 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testStartTransactionIdleExpiration()\n throws Exception\n {\n Session session = sessionBuilder()\n .setClientTransactionSupport()\n .build();\n TransactionManager transactionManager = InMemoryTransactionManager.create(\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/StartTransactionTask.java",
"identifier": "StartTransactionTask",
"interfaces": "implements DataDefinitionTask<StartTransaction>",
"methods": [
{
"class_method_signature": "StartTransactionTask.getName()",
"constructor":... | {
"body": "@Override\n public ListenableFuture<?> execute(StartTransaction statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (!sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_797 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testToIEEE754Binary64()\n {\n assertFunction(\"to_ieee754_64(0.0)\", VARBINARY, sqlVarbinaryFromHex(\"0000000000000000\"));\n assertFunction(\"to_ieee754_64(1.0)\", VARBINARY, sqlVarbinaryFromHex(\"3FF0000000000000\"));\n assertFunction(\"to_ieee754_64(3.14159... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Encode value as a big endian varbinary according to IEEE 754 double-precision floating-point format\")\n @ScalarFunction(\"to_ieee754_64\")\n @SqlType(StandardTypes.VARBINARY)\n public static Slice toIEEE754Binary64(@SqlType(StandardTypes.DOUBLE) double value)\n {\n Slice ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_328 | {
"fields": [],
"file": "presto-jdbc/src/test/java/io/prestosql/jdbc/TestPrestoDriverUri.java",
"identifier": "TestPrestoDriverUri",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUriWithSocksProxy()\n throws SQLException\n {\n PrestoDriverUri parameters = createDriverUri(\"presto://localhost:8080?socksProxy=localhost:1234\");\n assertUriPortScheme(parameters, 8080, \"http\");\n\n Properties properties = parameters.getPro... | {
"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_282 | {
"fields": [],
"file": "presto-prometheus/src/test/java/io/prestosql/plugin/prometheus/TestPrometheusTimestampDeserializer.java",
"identifier": "TestPrometheusTimestampDeserializer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDeserializeTimestamp()\n {\n Instant now = Instant.now();\n long nowEpochMillis = now.toEpochMilli();\n String nowTimeStr = PrometheusSplitManager.decimalSecondString(nowEpochMillis);\n Instant nowTimestampActual = PrometheusTimestampDeserializer.de... | {
"fields": [],
"file": "presto-prometheus/src/main/java/io/prestosql/plugin/prometheus/PrometheusTimestampDeserializer.java",
"identifier": "PrometheusTimestampDeserializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PrometheusTimestampDeserializer.deserialize(JsonParser jsonParse... | {
"body": "static Instant decimalEpochTimestampToSQLTimestamp(String timestamp)\n {\n long promTimestampMillis = (long) (Double.parseDouble(timestamp) * 1000);\n return ofEpochMilli(promTimestampMillis);\n }",
"class_method_signature": "PrometheusTimestampDeserializer.decimalEpochTimestampToSQLT... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_778 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestJsonFunctions.java",
"identifier": "TestJsonFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testIsJsonScalar()\n {\n assertFunction(\"IS_JSON_SCALAR(null)\", BOOLEAN, null);\n\n assertFunction(\"IS_JSON_SCALAR(JSON 'null')\", BOOLEAN, true);\n assertFunction(\"IS_JSON_SCALAR(JSON 'true')\", BOOLEAN, true);\n assertFunction(\"IS_JSON_SCALAR(JSO... | {
"fields": [
{
"declarator": "JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES)",
"modifier": "private static final",
"original_string": "private static final JsonFactory JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES);",
"ty... | {
"body": "@ScalarFunction\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean isJsonScalar(@SqlType(StandardTypes.JSON) Slice json)\n {\n try (JsonParser parser = createJsonParser(JSON_FACTORY, json)) {\n JsonToken nextToken = parser.nextToken();\n if (nextToken == null) {... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1032 | {
"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 testGroupByWithQualifiedName3()\n {\n // TODO: verify output\n analyze(\"SELECT * FROM t1 GROUP BY t1.a, t1.b, t1.c, t1.d\");\n }",
"class_method_signature": "TestAnalyzer.testGroupByWithQualifiedName3()",
"constructor": false,
"full_signature": "@Test publi... | {
"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_1198 | {
"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 testSharedBufferBlockingNoBlockOnFull()\n {\n SettableFuture<?> blockedFuture = SettableFuture.create();\n MockMemoryReservationHandler reservationHandler = new MockMemoryReservationHandler(blockedFuture);\n AggregatedMemoryContext memoryContext = newRootAggre... | {
"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": "@VisibleForTesting\n OutputBufferMemoryManager getMemoryManager()\n {\n return memoryManager;\n }",
"class_method_signature": "BroadcastOutputBuffer.getMemoryManager()",
"constructor": false,
"full_signature": "@VisibleForTesting OutputBufferMemoryManager getMemoryManager()",
"ident... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_955 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
}
],
"file": "presto-main/src/test/java/io/pres... | {
"body": "@Test\n public void testDoesNotPushStraddlingProjection()\n {\n PlanBuilder p = new PlanBuilder(new PlanNodeIdAllocator(), dummyMetadata());\n Symbol a = p.symbol(\"a\");\n Symbol b = p.symbol(\"b\");\n Symbol c = p.symbol(\"c\");\n\n ProjectNode planNode = p.projec... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/PushProjectionThroughJoin.java",
"identifier": "PushProjectionThroughJoin",
"interfaces": "",
"methods": [
{
"class_method_signature": "PushProjectionThroughJoin.pushProjectionThroughJoin(Metadata metadata, Pr... | {
"body": "public static Optional<PlanNode> pushProjectionThroughJoin(Metadata metadata, ProjectNode projectNode, Lookup lookup, PlanNodeIdAllocator planNodeIdAllocator)\n {\n if (!projectNode.getAssignments().getExpressions().stream().allMatch(expression -> isDeterministic(expression, metadata))) {\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_406 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTCrosses()\n {\n assertFunction(\"ST_Crosses(ST_GeometryFromText('POINT (20 20)'), ST_GeometryFromText('POINT (25 25)'))\", BOOLEAN, false);\n assertFunction(\"ST_Crosses(ST_GeometryFromText('LINESTRING (20 20, 30 30)'), ST_GeometryFromText('POINT (25 25)'))\", ... | {
"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 TRUE if the supplied geometries have some, but not all, interior points in common\")\n @ScalarFunction(\"ST_Crosses\")\n @SqlType(BOOLEAN)\n public static Boolean stCrosses(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right)\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_113 | {
"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 testInvalidGetPartitionNamesByParts()\n {\n assertFalse(metastore.getPartitionNamesByFilter(IDENTITY, BAD_DATABASE, TEST_TABLE, PARTITION_COLUMN_NAMES, TupleDomain.all()).isPresent());\n }",
"class_method_signature": "TestCachingHiveMetastore.testInvalidGetPartitionNam... | {
"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 Optional<List<String>> getPartitionNamesByFilter(HiveIdentity identity, String databaseName, String tableName, List<String> columnNames, TupleDomain<String> partitionKeysFilter)\n {\n if (partitionKeysFilter.isNone()) {\n return Optional.of(ImmutableList.of());\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_543 | {
"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 testUserGroupsConfiguration()\n {\n ManagerSpec spec = parseManagerSpec(\"resource_groups_config_user_groups.json\");\n\n assertThat(spec.getSelectors()\n .stream()\n .map(SelectorSpec::getUserGroupRegex)\n .map(pattern ->... | {
"fields": [
{
"declarator": "CODEC = new JsonCodecFactory(\n () -> new ObjectMapperProvider().get().enable(FAIL_ON_UNKNOWN_PROPERTIES))\n .jsonCodec(ManagerSpec.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ManagerSpec> CO... | {
"body": "@VisibleForTesting\n static ManagerSpec parseManagerSpec(FileResourceGroupConfig config)\n {\n requireNonNull(config, \"config is null\");\n\n ManagerSpec managerSpec;\n try {\n managerSpec = CODEC.fromJson(Files.readAllBytes(Paths.get(config.getConfigFile())));\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_1209 | {
"fields": [
{
"declarator": "executor = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private",
"original_string": "private ExecutorService executor = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"));",
"type": "... | {
"body": "@Test\n public void testTrySet()\n throws Exception\n {\n StateMachine<State> stateMachine = new StateMachine<>(\"test\", executor, State.BREAKFAST, ImmutableSet.of(State.DINNER));\n assertEquals(stateMachine.get(), State.BREAKFAST);\n\n assertNoStateChange(stateMachin... | {
"fields": [
{
"declarator": "log = Logger.get(StateMachine.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(StateMachine.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "name",
"modifi... | {
"body": "public T trySet(T newState)\n {\n checkState(!Thread.holdsLock(lock), \"Cannot set state while holding the lock\");\n requireNonNull(newState, \"newState is null\");\n\n T oldState;\n FutureStateChange<T> futureStateChange;\n ImmutableList<StateChangeListener<T>> state... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_810 | {
"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 testAtan()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"atan(\" + doubleValue + \")\", DOUBLE, Math.atan(doubleValue));\n assertFunction(\"atan(REAL '\" + (float) doubleValue + \"')\", DOUBLE, Math.atan((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(\"Arc tangent\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double atan(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.atan(num);\n }",
"class_method_signature": "MathFunctions.atan(@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_65 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBuildGlueExpressionTupleDomainEqualsAndInClause()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addStringValues(\"col1\", \"2020-01-01\")\n .addStringValues(\"col2\", \"2020-02-20\", \"2020-02-28\")\n .bu... | {
"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_390 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTLength()\n {\n assertFunction(\"ST_Length(ST_GeometryFromText('LINESTRING EMPTY'))\", DOUBLE, 0.0);\n assertFunction(\"ST_Length(ST_GeometryFromText('LINESTRING (0 0, 2 2)'))\", DOUBLE, 2.8284271247461903);\n assertFunction(\"ST_Length(ST_GeometryFromTex... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns the length of a LineString or Multi-LineString using Euclidean measurement on a 2D plane (based on spatial ref) in projected units\")\n @ScalarFunction(\"ST_Length\")\n @SqlType(DOUBLE)\n public static double stLength(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\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_1120 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/ui/TestFixedUserWebUiConfig.java",
"identifier": "TestFixedUserWebUiConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(FixedUserWebUiConfig.class)\n .setUsername(null));\n }",
"class_method_signature": "TestFixedUserWebUiConfig.testDefaults()",
"constructor": false,
"full_signature": "@Test public void testDe... | {
"fields": [
{
"declarator": "username",
"modifier": "private",
"original_string": "private String username;",
"type": "String",
"var_name": "username"
}
],
"file": "presto-main/src/main/java/io/prestosql/server/ui/FixedUserWebUiConfig.java",
"identifier": "FixedUserWebUiC... | {
"body": "@Config(\"web-ui.user\")\n public FixedUserWebUiConfig setUsername(String username)\n {\n this.username = username;\n return this;\n }",
"class_method_signature": "FixedUserWebUiConfig.setUsername(String username)",
"constructor": false,
"full_signature": "@Config(\"web-ui.user... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1065 | {
"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 testLambdaInAggregationContext()\n {\n analyze(\"SELECT apply(sum(x), i -> i * i) FROM (VALUES 1, 2, 3, 4, 5) t(x)\");\n analyze(\"SELECT apply(x, i -> i - 1), sum(y) FROM (VALUES (1, 10), (1, 20), (2, 50)) t(x,y) group by x\");\n analyze(\"SELECT x, apply(sum... | {
"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_685 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestIntegerOperators.java",
"identifier": "TestIntegerOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testModulus()\n {\n assertFunction(\"INTEGER'37' % INTEGER'37'\", INTEGER, 0);\n assertFunction(\"INTEGER'37' % INTEGER'17'\", INTEGER, 37 % 17);\n assertFunction(\"INTEGER'17' % INTEGER'37'\", INTEGER, 17 % 37);\n assertFunction(\"INTEGER'17' % INTEGER... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/IntegerOperators.java",
"identifier": "IntegerOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "IntegerOperators.IntegerOperators()",
"constructor": true,
"full_signature": "private IntegerOperato... | {
"body": "@ScalarOperator(MODULUS)\n @SqlType(StandardTypes.INTEGER)\n public static long modulus(@SqlType(StandardTypes.INTEGER) long left, @SqlType(StandardTypes.INTEGER) long right)\n {\n try {\n return left % right;\n }\n catch (ArithmeticException e) {\n throw... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_410 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTOverlaps()\n {\n assertFunction(\"ST_Overlaps(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)'))\", BOOLEAN, false);\n assertFunction(\"ST_Overlaps(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (50 100)'))\", BOOL... | {
"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 TRUE if the Geometries share space, are of the same dimension, but are not completely contained by each other\")\n @ScalarFunction(\"ST_Overlaps\")\n @SqlType(BOOLEAN)\n public static Boolean stOverlaps(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOM... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_943 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestTransformExistsApplyToCorrelatedJoin.java",
"identifier": "TestTransformExistsApplyToCorrelatedJoin",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testRewrite()\n {\n tester().assertThat(new TransformExistsApplyToCorrelatedJoin(tester().getMetadata()))\n .on(p ->\n p.apply(\n Assignments.of(p.symbol(\"b\", BOOLEAN), expression(\"EXISTS(SELECT TRUE)\"... | {
"fields": [
{
"declarator": "PATTERN = applyNode()",
"modifier": "private static final",
"original_string": "private static final Pattern<ApplyNode> PATTERN = applyNode();",
"type": "Pattern<ApplyNode>",
"var_name": "PATTERN"
},
{
"declarator": "COUNT = QualifiedName.... | {
"body": "@Override\n public Result apply(ApplyNode parent, Captures captures, Context context)\n {\n if (parent.getSubqueryAssignments().size() != 1) {\n return Result.empty();\n }\n\n Expression expression = getOnlyElement(parent.getSubqueryAssignments().getExpressions());\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_73 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBuildGlueExpressionMaxLengthNone()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addStringValues(\"col1\", \"x\".repeat(101))\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_806 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testReverse()\n {\n assertFunction(\"REVERSE(CAST('' AS VARBINARY))\", VARBINARY, sqlVarbinary(\"\"));\n assertFunction(\"REVERSE(CAST('hello' AS VARBINARY))\", VARBINARY, sqlVarbinary(\"olleh\"));\n assertFunction(\"REVERSE(CAST('Quadratically' AS VARBINARY))... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Reverse a given varbinary\")\n @ScalarFunction(\"reverse\")\n @SqlType(StandardTypes.VARBINARY)\n public static Slice reverse(@SqlType(\"varbinary\") Slice inputSlice)\n {\n if (inputSlice.length() == 0) {\n return EMPTY_SLICE;\n }\n int length = 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_555 | {
"fields": [
{
"declarator": "metadata = new BlackHoleMetadata()",
"modifier": "private final",
"original_string": "private final BlackHoleMetadata metadata = new BlackHoleMetadata();",
"type": "BlackHoleMetadata",
"var_name": "metadata"
},
{
"declarator": "tableProper... | {
"body": "@Test\n public void testCreateSchema()\n {\n assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of(\"default\"));\n metadata.createSchema(SESSION, \"test\", ImmutableMap.of(), new PrestoPrincipal(USER, SESSION.getUser()));\n assertEquals(metadata.listSchemaNames(SESSIO... | {
"fields": [
{
"declarator": "SCHEMA_NAME = \"default\"",
"modifier": "public static final",
"original_string": "public static final String SCHEMA_NAME = \"default\";",
"type": "String",
"var_name": "SCHEMA_NAME"
},
{
"declarator": "schemas = new ArrayList<>()",
... | {
"body": "@Override\n public synchronized void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties, PrestoPrincipal owner)\n {\n if (schemas.contains(schemaName)) {\n throw new PrestoException(ALREADY_EXISTS, format(\"Schema [%s] already exists\", schemaNa... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_105 | {
"fields": [
{
"declarator": "DEFAULT_CLIENT = createFakeMetastoreClient()",
"modifier": "private static final",
"original_string": "private static final ThriftMetastoreClient DEFAULT_CLIENT = createFakeMetastoreClient();",
"type": "ThriftMetastoreClient",
"var_name": "DEFAULT_CLIEN... | {
"body": "@Test\n public void testFallbackHiveMetastoreWithHiveUser()\n throws TException\n {\n MetastoreLocator locator = createMetastoreLocator(CONFIG_WITH_FALLBACK_WITH_USER, ImmutableMap.of(DEFAULT_URI, Optional.empty(), FALLBACK_URI, Optional.empty(), FALLBACK2_URI, Optional.of(FALLBACK_... | {
"fields": [
{
"declarator": "addresses",
"modifier": "private final",
"original_string": "private final List<HostAndPort> addresses;",
"type": "List<HostAndPort>",
"var_name": "addresses"
},
{
"declarator": "backoffs",
"modifier": "private final",
"origina... | {
"body": "@Override\n public ThriftMetastoreClient createMetastoreClient(Optional<String> delegationToken)\n throws TException\n {\n List<Integer> indices = backoffs.stream()\n .sorted(Comparator.comparingLong(Backoff::getBackoffDuration))\n .map(backoffs::indexO... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1136 | {
"fields": [
{
"declarator": "QUERY = \"sql\"",
"modifier": "private static final",
"original_string": "private static final String QUERY = \"sql\";",
"type": "String",
"var_name": "QUERY"
},
{
"declarator": "LOCATION = URI.create(\"fake://fake-query\")",
"modifi... | {
"body": "@Test\n public void testFailed()\n {\n QueryStateMachine stateMachine = createQueryStateMachine();\n assertTrue(stateMachine.transitionToFailed(FAILED_CAUSE));\n assertFinalState(stateMachine, FAILED, FAILED_CAUSE);\n }",
"class_method_signature": "TestQueryStateMachine.test... | {
"fields": [
{
"declarator": "QUERY_STATE_LOG = Logger.get(QueryStateMachine.class)",
"modifier": "private static final",
"original_string": "private static final Logger QUERY_STATE_LOG = Logger.get(QueryStateMachine.class);",
"type": "Logger",
"var_name": "QUERY_STATE_LOG"
},
... | {
"body": "public boolean transitionToFailed(Throwable throwable)\n {\n cleanupQueryQuietly();\n queryStateTimer.endQuery();\n\n // NOTE: The failure cause must be set before triggering the state change, so\n // listeners can observe the exception. This is safe because the failure cause... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_386 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTIsEmpty()\n {\n assertFunction(\"ST_IsEmpty(ST_GeometryFromText('POINT (1.5 2.5)'))\", BOOLEAN, false);\n assertFunction(\"ST_IsEmpty(ST_GeometryFromText('POLYGON EMPTY'))\", BOOLEAN, true);\n }",
"class_method_signature": "TestGeoFunctions.testSTIsEmpty()... | {
"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 TRUE if this Geometry is an empty geometrycollection, polygon, point etc\")\n @ScalarFunction(\"ST_IsEmpty\")\n @SqlType(BOOLEAN)\n public static Boolean stIsEmpty(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n return deserializeEnvelope(input).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_693 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestBooleanOperators.java",
"identifier": "TestBooleanOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToVarchar()\n {\n assertFunction(\"cast(true as varchar)\", VARCHAR, \"true\");\n assertFunction(\"cast(false as varchar)\", VARCHAR, \"false\");\n }",
"class_method_signature": "TestBooleanOperators.testCastToVarchar()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "TRUE = Slices.copiedBuffer(\"true\", US_ASCII)",
"modifier": "private static final",
"original_string": "private static final Slice TRUE = Slices.copiedBuffer(\"true\", US_ASCII);",
"type": "Slice",
"var_name": "TRUE"
},
{
"declarator": "F... | {
"body": "@ScalarOperator(CAST)\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice castToVarchar(@SqlType(StandardTypes.BOOLEAN) boolean value)\n {\n return value ? TRUE : FALSE;\n }",
"class_method_signature": "BooleanOperators.castToVarchar(@SqlType(StandardTypes.B... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_369 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestBingTileFunctions.java",
"identifier": "TestBingTileFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testBingTileZoomLevel()\n {\n assertFunction(\"bing_tile_zoom_level(bing_tile('213'))\", TINYINT, (byte) 3);\n assertFunction(\"bing_tile_zoom_level(bing_tile('123030123010121'))\", TINYINT, (byte) 15);\n }",
"class_method_signature": "TestBingTileFunctions.test... | {
"fields": [
{
"declarator": "TILE_PIXELS = 256",
"modifier": "private static final",
"original_string": "private static final int TILE_PIXELS = 256;",
"type": "int",
"var_name": "TILE_PIXELS"
},
{
"declarator": "MAX_LATITUDE = 85.05112878",
"modifier": "private ... | {
"body": "@Description(\"Given a Bing tile, returns zoom level of the tile\")\n @ScalarFunction(\"bing_tile_zoom_level\")\n @SqlType(StandardTypes.TINYINT)\n public static long bingTileZoomLevel(@SqlType(BingTileType.NAME) long input)\n {\n return BingTile.decode(input).getZoomLevel();\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_739 | {
"fields": [
{
"declarator": "factory",
"modifier": "private final",
"original_string": "private final AccumulatorFactory factory;",
"type": "AccumulatorFactory",
"var_name": "factory"
},
{
"declarator": "input",
"modifier": "private final",
"original_strin... | {
"body": "@Test\n public void testMerge()\n {\n Accumulator singleStep = factory.createAccumulator();\n singleStep.addInput(input);\n Block singleStepResult = getFinalBlock(singleStep);\n\n Accumulator partialStep = factory.createAccumulator();\n partialStep.addInput(input);\... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/aggregation/RealHistogramAggregation.java",
"identifier": "RealHistogramAggregation",
"interfaces": "",
"methods": [
{
"class_method_signature": "RealHistogramAggregation.RealHistogramAggregation()",
"constructor": true,
... | {
"body": "@CombineFunction\n public static void merge(@AggregationState DoubleHistogramAggregation.State state, @AggregationState DoubleHistogramAggregation.State other)\n {\n DoubleHistogramAggregation.merge(state, other);\n }",
"class_method_signature": "RealHistogramAggregation.merge(@Aggregatio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1073 | {
"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 testJoinLateral()\n {\n // Lateral references are only allowed in INNER and LEFT join.\n analyze(\"SELECT * FROM (VALUES array[2, 2]) a(x) CROSS JOIN LATERAL(VALUES x)\");\n analyze(\"SELECT * FROM (VALUES array[2, 2]) a(x) LEFT OUTER JOIN LATERAL(VALUES x) ON... | {
"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_914 | {
"fields": [
{
"declarator": "C_BIGINT = new Symbol(\"c_bigint\")",
"modifier": "private static final",
"original_string": "private static final Symbol C_BIGINT = new Symbol(\"c_bigint\");",
"type": "Symbol",
"var_name": "C_BIGINT"
},
{
"declarator": "C_DOUBLE = new Sy... | {
"body": "@Test\n public void testRoundTrip()\n {\n TupleDomain<Symbol> tupleDomain = withColumnDomains(ImmutableMap.<Symbol, Domain>builder()\n .put(C_BIGINT, Domain.singleValue(BIGINT, 1L))\n .put(C_DOUBLE, Domain.onlyNull(DOUBLE))\n .put(C_VARCHAR, Domain.... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private final",
"original_string": "private final Metadata metadata;",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "literalEncoder",
"modifier": "private final",
"original_string": "pri... | {
"body": "public Expression toPredicate(TupleDomain<Symbol> tupleDomain)\n {\n if (tupleDomain.isNone()) {\n return FALSE_LITERAL;\n }\n\n Map<Symbol, Domain> domains = tupleDomain.getDomains().get();\n return domains.entrySet().stream()\n .map(entry -> toPred... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_447 | {
"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 testAddReturnOverflow()\n {\n assertAddReturnOverflow(TWO, TWO);\n assertAddReturnOverflow(MAX_DECIMAL_UNSCALED_VALUE, MAX_DECIMAL_UNSCALED_VALUE);\n assertAddReturnOverflow(MAX_DECIMAL_UNSCALED_VALUE.negate(), MAX_DECIMAL_UNSCALED_VALUE);\n assertAddRe... | {
"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 void negate(Slice decimal)\n {\n setNegative(decimal, !isNegative(decimal));\n }",
"class_method_signature": "UnscaledDecimal128Arithmetic.negate(Slice decimal)",
"constructor": false,
"full_signature": "public static void negate(Slice decimal)",
"identifier": "negate",
... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_152 | {
"fields": [
{
"declarator": "CONTEXT = new HdfsContext(SESSION, \"test_schema\")",
"modifier": "private static final",
"original_string": "private static final HdfsContext CONTEXT = new HdfsContext(SESSION, \"test_schema\");",
"type": "HdfsContext",
"var_name": "CONTEXT"
}
],... | {
"body": "@Test\n public void testIsS3FileSystem()\n {\n assertTrue(isS3FileSystem(CONTEXT, HDFS_ENVIRONMENT, new Path(\"s3://test-bucket/test-folder\")));\n assertFalse(isS3FileSystem(CONTEXT, HDFS_ENVIRONMENT, new Path(\"/test-dir/test-folder\")));\n }",
"class_method_signature": "TestHive... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/util/HiveWriteUtils.java",
"identifier": "HiveWriteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "HiveWriteUtils.HiveWriteUtils()",
"constructor": true,
"full_signature": "private HiveWriteU... | {
"body": "public static boolean isS3FileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path)\n {\n try {\n FileSystem fileSystem = getRawFileSystem(hdfsEnvironment.getFileSystem(context, path));\n return fileSystem instanceof PrestoS3FileSystem || fileSystem.getClas... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_502 | {
"fields": [
{
"declarator": "CODEC = createTestingViewCodec()",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ConnectorViewDefinition> CODEC = createTestingViewCodec();",
"type": "JsonCodec<ConnectorViewDefinition>",
"var_name": "CODEC"
... | {
"body": "@Test\n public void testLegacyViewWithoutOwner()\n {\n // very old view before owner was added\n ConnectorViewDefinition view = CODEC.fromJson(\"{\" + BASE_JSON + \"}\");\n assertBaseView(view);\n assertFalse(view.getOwner().isPresent());\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "originalSql",
"modifier": "private final",
"original_string": "private final String originalSql;",
"type": "String",
"var_name": "originalSql"
},
{
"declarator": "catalog",
"modifier": "private final",
"original_string": "priva... | {
"body": "@JsonProperty\n public Optional<String> getOwner()\n {\n return owner;\n }",
"class_method_signature": "ConnectorViewDefinition.getOwner()",
"constructor": false,
"full_signature": "@JsonProperty public Optional<String> getOwner()",
"identifier": "getOwner",
"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_1248 | {
"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 testDouble()\n {\n assertEquals(getDomain(DOUBLE, 0, null), none(DOUBLE));\n assertEquals(getDomain(DOUBLE, 10, null), all(DOUBLE));\n\n assertEquals(getDomain(DOUBLE, 0, doubleColumnStats(null, null, null)), none(DOUBLE));\n assertEquals(getDomain(DOUB... | {
"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_24 | {
"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 testTableRulesForCheckCanShowColumns()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanShowColumns(ALICE, 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 checkCanShowColumns(SystemSecurityContext context, CatalogSchemaTableName table)\n {\n if (!checkAnyTablePermission(context, table)) {\n denyShowColumns(table.toString());\n }\n }",
"class_method_signature": "FileBasedSystemAccessControl.checkCanS... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_851 | {
"fields": [
{
"declarator": "TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY",
"modifier": "protected static final",
"original_string": "protected static final TimeZoneKey TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY;",
"type": "TimeZoneKey",
"var_name": "TIME_ZONE_KEY... | {
"body": "@Test\n public void testParseDatetime()\n {\n // Modern date\n assertFunction(\"parse_datetime('2020-08-18 03:04:05.678', 'yyyy-MM-dd HH:mm:ss.SSS')\",\n TIMESTAMP_WITH_TIME_ZONE,\n toTimestampWithTimeZone(new DateTime(2020, 8, 18, 3, 4, 5, 678, DATE_TIME_Z... | {
"fields": [
{
"declarator": "DATETIME_FORMATTER_CACHE =\n new ThreadLocalCache<>(100, DateTimeFunctions::createDateTimeFormatter)",
"modifier": "private static final",
"original_string": "private static final ThreadLocalCache<Slice, DateTimeFormatter> DATETIME_FORMATTER_CACHE =\n ... | {
"body": "@Description(\"Parses the specified date/time by the given format\")\n @ScalarFunction\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(\"timestamp(3) with time zone\")\n public static long parseDatetime(ConnectorSession session, @SqlType(\"varchar(x)\") Slice datetime, @SqlType(\"varchar(y)\") ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_781 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestJsonFunctions.java",
"identifier": "TestJsonFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testJsonSize()\n {\n assertFunction(format(\"JSON_SIZE('%s', '%s')\", \"{\\\"x\\\": {\\\"a\\\" : 1, \\\"b\\\" : 2} }\", \"$\"), BIGINT, 1L);\n assertFunction(format(\"JSON_SIZE('%s', '%s')\", \"{\\\"x\\\": {\\\"a\\\" : 1, \\\"b\\\" : 2} }\", \"$.x\"), BIGINT, 2L);\n ... | {
"fields": [
{
"declarator": "JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES)",
"modifier": "private static final",
"original_string": "private static final JsonFactory JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES);",
"ty... | {
"body": "@ScalarFunction\n @SqlNullable\n @SqlType(StandardTypes.BIGINT)\n public static Long jsonSize(@SqlType(StandardTypes.JSON) Slice json, @SqlType(JsonPathType.NAME) JsonPath jsonPath)\n {\n return JsonExtract.extract(json, jsonPath.getSizeExtractor());\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_1161 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testUnknownTransactionRollback()\n {\n TransactionManager transactionManager = createTestTransactionManager();\n\n Session session = sessionBuilder()\n .setTransactionId(TransactionId.create()) // Use a random transaction ID that is unknown to the syst... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/RollbackTask.java",
"identifier": "RollbackTask",
"interfaces": "implements DataDefinitionTask<Rollback>",
"methods": [
{
"class_method_signature": "RollbackTask.getName()",
"constructor": false,
"full_signature": ... | {
"body": "@Override\n public ListenableFuture<?> execute(Rollback statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (session.getTran... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1024 | {
"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 testOrderByWithGroupByAndSubquerySelectExpression()\n {\n analyze(\"SELECT a FROM t1 GROUP BY a ORDER BY (SELECT a)\");\n\n assertFails(\"SELECT a FROM t1 GROUP BY a ORDER BY (SELECT b)\")\n .hasErrorCode(EXPRESSION_NOT_AGGREGATE)\n .has... | {
"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_294 | {
"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 testFromValueSetNone()\n {\n PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.none(BIGINT));\n assertNotNull(thriftValueSet.getRangeValueSet());\n assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of());\n }",
"class_met... | {
"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_780 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestJsonFunctions.java",
"identifier": "TestJsonFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testJsonFormat()\n {\n assertFunction(\"JSON_FORMAT(JSON '[\\\"a\\\", \\\"b\\\"]')\", VARCHAR, \"[\\\"a\\\",\\\"b\\\"]\");\n }",
"class_method_signature": "TestJsonFunctions.testJsonFormat()",
"constructor": false,
"full_signature": "@Test public void testJsonForma... | {
"fields": [
{
"declarator": "JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES)",
"modifier": "private static final",
"original_string": "private static final JsonFactory JSON_FACTORY = new JsonFactory()\n .disable(CANONICALIZE_FIELD_NAMES);",
"ty... | {
"body": "@ScalarFunction\n @SqlType(StandardTypes.VARCHAR)\n public static Slice jsonFormat(@SqlType(StandardTypes.JSON) Slice slice)\n {\n return slice;\n }",
"class_method_signature": "JsonFunctions.jsonFormat(@SqlType(StandardTypes.JSON) Slice slice)",
"constructor": false,
"full_signatu... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1160 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testNoTransactionRollback()\n {\n TransactionManager transactionManager = createTestTransactionManager();\n\n Session session = sessionBuilder()\n .build();\n QueryStateMachine stateMachine = createQueryStateMachine(\"ROLLBACK\", session, transa... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/RollbackTask.java",
"identifier": "RollbackTask",
"interfaces": "implements DataDefinitionTask<Rollback>",
"methods": [
{
"class_method_signature": "RollbackTask.getName()",
"constructor": false,
"full_signature": ... | {
"body": "@Override\n public ListenableFuture<?> execute(Rollback statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (session.getTran... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1025 | {
"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 testTooManyGroupingElements()\n {\n Session session = testSessionBuilder(new SessionPropertyManager(new SystemSessionProperties(\n new QueryManagerConfig(),\n new TaskManagerConfig(),\n new MemoryManagerConfig(),\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_295 | {
"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 testFromValueSetOf()\n {\n PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.of(BIGINT, 1L, 2L, 3L));\n assertNotNull(thriftValueSet.getRangeValueSet());\n assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of(\n ... | {
"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_915 | {
"fields": [
{
"declarator": "C_BIGINT = new Symbol(\"c_bigint\")",
"modifier": "private static final",
"original_string": "private static final Symbol C_BIGINT = new Symbol(\"c_bigint\");",
"type": "Symbol",
"var_name": "C_BIGINT"
},
{
"declarator": "C_DOUBLE = new Sy... | {
"body": "@Test\n public void testInOptimization()\n {\n Domain testDomain = Domain.create(\n ValueSet.all(BIGINT)\n .subtract(ValueSet.ofRanges(\n Range.equal(BIGINT, 1L), Range.equal(BIGINT, 2L), Range.equal(BIGINT, 3L))), false);\n\... | {
"fields": [
{
"declarator": "metadata",
"modifier": "private final",
"original_string": "private final Metadata metadata;",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "literalEncoder",
"modifier": "private final",
"original_string": "pri... | {
"body": "public Expression toPredicate(TupleDomain<Symbol> tupleDomain)\n {\n if (tupleDomain.isNone()) {\n return FALSE_LITERAL;\n }\n\n Map<Symbol, Domain> domains = tupleDomain.getDomains().get();\n return domains.entrySet().stream()\n .map(entry -> toPred... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_446 | {
"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 testAdd()\n {\n assertEquals(add(unscaledDecimal(0), unscaledDecimal(0)), unscaledDecimal(0));\n assertEquals(add(unscaledDecimal(1), unscaledDecimal(0)), unscaledDecimal(1));\n assertEquals(add(unscaledDecimal(1), unscaledDecimal(1)), unscaledDecimal(2));\n\n... | {
"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_153 | {
"fields": [
{
"declarator": "CONTEXT = new HdfsContext(SESSION, \"test_schema\")",
"modifier": "private static final",
"original_string": "private static final HdfsContext CONTEXT = new HdfsContext(SESSION, \"test_schema\");",
"type": "HdfsContext",
"var_name": "CONTEXT"
}
],... | {
"body": "@Test\n public void testIsViewFileSystem()\n {\n Path viewfsPath = new Path(\"viewfs://ns-default/test-folder\");\n Path nonViewfsPath = new Path(\"hdfs://localhost/test-dir/test-folder\");\n\n // ViewFS check requires the mount point config\n HDFS_ENVIRONMENT.getConfigura... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/util/HiveWriteUtils.java",
"identifier": "HiveWriteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "HiveWriteUtils.HiveWriteUtils()",
"constructor": true,
"full_signature": "private HiveWriteU... | {
"body": "public static boolean isViewFileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path)\n {\n try {\n return getRawFileSystem(hdfsEnvironment.getFileSystem(context, path)) instanceof ViewFileSystem;\n }\n catch (IOException e) {\n throw new Pres... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_503 | {
"fields": [
{
"declarator": "CODEC = createTestingViewCodec()",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ConnectorViewDefinition> CODEC = createTestingViewCodec();",
"type": "JsonCodec<ConnectorViewDefinition>",
"var_name": "CODEC"
... | {
"body": "@Test\n public void testViewComment()\n {\n ConnectorViewDefinition view = CODEC.fromJson(\"{\" + BASE_JSON + \", \\\"comment\\\": \\\"hello\\\"}\");\n assertBaseView(view);\n assertEquals(view.getComment(), Optional.of(\"hello\"));\n }",
"class_method_signature": "TestConne... | {
"fields": [
{
"declarator": "originalSql",
"modifier": "private final",
"original_string": "private final String originalSql;",
"type": "String",
"var_name": "originalSql"
},
{
"declarator": "catalog",
"modifier": "private final",
"original_string": "priva... | {
"body": "@JsonProperty\n public Optional<String> getComment()\n {\n return comment;\n }",
"class_method_signature": "ConnectorViewDefinition.getComment()",
"constructor": false,
"full_signature": "@JsonProperty public Optional<String> getComment()",
"identifier": "getComment",
"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_1249 | {
"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 testFloat()\n {\n assertEquals(getDomain(REAL, 0, null), none(REAL));\n assertEquals(getDomain(REAL, 10, null), all(REAL));\n\n assertEquals(getDomain(REAL, 0, doubleColumnStats(null, null, null)), none(REAL));\n assertEquals(getDomain(REAL, 0, doubleCo... | {
"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_850 | {
"fields": [
{
"declarator": "TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY",
"modifier": "protected static final",
"original_string": "protected static final TimeZoneKey TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY;",
"type": "TimeZoneKey",
"var_name": "TIME_ZONE_KEY... | {
"body": "@Test\n public void testTruncateDate()\n {\n DateTime result = DATE;\n assertFunction(\"date_trunc('day', \" + DATE_LITERAL + \")\", DateType.DATE, toDate(result));\n\n result = result.withDayOfMonth(20);\n assertFunction(\"date_trunc('week', \" + DATE_LITERAL + \")\", Dat... | {
"fields": [
{
"declarator": "DATETIME_FORMATTER_CACHE =\n new ThreadLocalCache<>(100, DateTimeFunctions::createDateTimeFormatter)",
"modifier": "private static final",
"original_string": "private static final ThreadLocalCache<Slice, DateTimeFormatter> DATETIME_FORMATTER_CACHE =\n ... | {
"body": "@Description(\"Truncate to the specified precision in the session timezone\")\n @ScalarFunction(\"date_trunc\")\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.DATE)\n public static long truncateDate(ConnectorSession session, @SqlType(\"varchar(x)\") Slice unit, @SqlType(StandardTypes.DATE... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_25 | {
"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 testTableRulesForFilterColumns()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n assertEquals(\n accessControl.filterColumns(ALICE, new CatalogSchemaTableName(\"some-catalog\", \"b... | {
"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 List<ColumnMetadata> filterColumns(SystemSecurityContext context, CatalogSchemaTableName tableName, List<ColumnMetadata> columns)\n {\n if (!checkAnyTablePermission(context, tableName)) {\n return ImmutableList.of();\n }\n\n return columns;\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_1137 | {
"fields": [
{
"declarator": "QUERY = \"sql\"",
"modifier": "private static final",
"original_string": "private static final String QUERY = \"sql\";",
"type": "String",
"var_name": "QUERY"
},
{
"declarator": "LOCATION = URI.create(\"fake://fake-query\")",
"modifi... | {
"body": "@Test\n public void testCanceled()\n {\n QueryStateMachine stateMachine = createQueryStateMachine();\n assertTrue(stateMachine.transitionToCanceled());\n assertFinalState(stateMachine, FAILED, new PrestoException(USER_CANCELED, \"canceled\"));\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "QUERY_STATE_LOG = Logger.get(QueryStateMachine.class)",
"modifier": "private static final",
"original_string": "private static final Logger QUERY_STATE_LOG = Logger.get(QueryStateMachine.class);",
"type": "Logger",
"var_name": "QUERY_STATE_LOG"
},
... | {
"body": "public boolean transitionToCanceled()\n {\n cleanupQueryQuietly();\n queryStateTimer.endQuery();\n\n // NOTE: The failure cause must be set before triggering the state change, so\n // listeners can observe the exception. This is safe because the failure cause\n // can ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_387 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTIsSimple()\n {\n assertSimpleGeometry(\"POINT (1.5 2.5)\");\n assertSimpleGeometry(\"MULTIPOINT (1 2, 2 4, 3 6, 4 8)\");\n assertNotSimpleGeometry(\"MULTIPOINT (1 2, 2 4, 3 6, 1 2)\");\n assertSimpleGeometry(\"LINESTRING (8 4, 5 7)\");\n as... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns TRUE if this Geometry has no anomalous geometric points, such as self intersection or self tangency\")\n @ScalarFunction(\"ST_IsSimple\")\n @SqlType(BOOLEAN)\n public static boolean stIsSimple(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = d... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_692 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestBooleanOperators.java",
"identifier": "TestBooleanOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCastToReal()\n {\n assertFunction(\"cast(true as real)\", REAL, 1.0f);\n assertFunction(\"cast(false as real)\", REAL, 0.0f);\n }",
"class_method_signature": "TestBooleanOperators.testCastToReal()",
"constructor": false,
"full_signature": "@Test public v... | {
"fields": [
{
"declarator": "TRUE = Slices.copiedBuffer(\"true\", US_ASCII)",
"modifier": "private static final",
"original_string": "private static final Slice TRUE = Slices.copiedBuffer(\"true\", US_ASCII);",
"type": "Slice",
"var_name": "TRUE"
},
{
"declarator": "F... | {
"body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.REAL)\n public static long castToReal(@SqlType(StandardTypes.BOOLEAN) boolean value)\n {\n return value ? floatToRawIntBits(1.0f) : floatToRawIntBits(0.0f);\n }",
"class_method_signature": "BooleanOperators.castToReal(@SqlType(StandardType... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_368 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestBingTileFunctions.java",
"identifier": "TestBingTileFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testBingTilesAround()\n {\n assertFunction(\n \"transform(bing_tiles_around(30.12, 60, 1), x -> bing_tile_quadkey(x))\",\n new ArrayType(VARCHAR),\n ImmutableList.of(\"0\", \"2\", \"1\", \"3\"));\n assertFunction(\n ... | {
"fields": [
{
"declarator": "TILE_PIXELS = 256",
"modifier": "private static final",
"original_string": "private static final int TILE_PIXELS = 256;",
"type": "int",
"var_name": "TILE_PIXELS"
},
{
"declarator": "MAX_LATITUDE = 85.05112878",
"modifier": "private ... | {
"body": "@Description(\"Given a (longitude, latitude) point, returns the surrounding Bing tiles at the specified zoom level\")\n @ScalarFunction(\"bing_tiles_around\")\n @SqlType(\"array(\" + BingTileType.NAME + \")\")\n public static Block bingTilesAround(\n @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_738 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/aggregation/TestApproximateMostFrequentHistogram.java",
"identifier": "TestApproximateMostFrequentHistogram",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMerge()\n {\n ApproximateMostFrequentHistogram<Long> histogram1 = new ApproximateMostFrequentHistogram<Long>(3, 15, LongApproximateMostFrequentStateSerializer::serializeBucket, LongApproximateMostFrequentStateSerializer::deserializeBucket);\n\n histogram1.add(1L)... | {
"fields": [
{
"declarator": "FORMAT_TAG = 0",
"modifier": "private static final",
"original_string": "private static final byte FORMAT_TAG = 0;",
"type": "byte",
"var_name": "FORMAT_TAG"
},
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(ApproximateMostFrequen... | {
"body": "public void merge(ApproximateMostFrequentHistogram<K> other)\n {\n List<Counter<K>> counters = other.streamSummary.topK(capacity);\n for (Counter<K> counter : counters) {\n add(counter.getItem(), counter.getCount());\n }\n }",
"class_method_signature": "ApproximateMo... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1072 | {
"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 testJoinUnnest()\n {\n // Lateral references are only allowed in INNER and LEFT join.\n analyze(\"SELECT * FROM (VALUES array[2, 2]) a(x) CROSS JOIN UNNEST(x)\");\n analyze(\"SELECT * FROM (VALUES array[2, 2]) a(x) LEFT OUTER JOIN UNNEST(x) ON true\");\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_411 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTRelate()\n {\n assertFunction(\"ST_Relate(ST_GeometryFromText('LINESTRING (0 0, 3 3)'), ST_GeometryFromText('LINESTRING (1 1, 4 1)'), '****T****')\", BOOLEAN, false);\n assertFunction(\"ST_Relate(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))'), ST_GeometryFrom... | {
"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 TRUE if this Geometry is spatially related to another Geometry\")\n @ScalarFunction(\"ST_Relate\")\n @SqlType(BOOLEAN)\n public static Boolean stRelate(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right, @SqlType(VARCHAR) Slic... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_942 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestPruneApplySourceColumns.java",
"identifier": "TestPruneApplySourceColumns",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testNoSubquerySymbolsReferenced()\n {\n tester().assertThat(new PruneApplySourceColumns())\n .on(p -> {\n Symbol a = p.symbol(\"a\");\n Symbol subquerySymbol = p.symbol(\"subquery_symbol\");\n Symbol in... | {
"fields": [
{
"declarator": "PATTERN = applyNode()",
"modifier": "private static final",
"original_string": "private static final Pattern<ApplyNode> PATTERN = applyNode();",
"type": "Pattern<ApplyNode>",
"var_name": "PATTERN"
}
],
"file": "presto-main/src/main/java/io/prest... | {
"body": "@Override\n public Result apply(ApplyNode applyNode, Captures captures, Context context)\n {\n Set<Symbol> subqueryAssignmentsSymbols = applyNode.getSubqueryAssignments().getExpressions().stream()\n .flatMap(expression -> SymbolsExtractor.extractUnique(expression).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_807 | {
"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 testAbs()\n {\n assertFunction(\"abs(TINYINT'123')\", TINYINT, (byte) 123);\n assertFunction(\"abs(TINYINT'-123')\", TINYINT, (byte) 123);\n assertFunction(\"abs(CAST(NULL AS TINYINT))\", TINYINT, null);\n assertFunction(\"abs(SMALLINT'123')\", SMALLINT... | {
"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(\"Absolute value\")\n @ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long abs(@SqlType(StandardTypes.BIGINT) long num)\n {\n checkCondition(num != Long.MIN_VALUE, NUMERIC_VALUE_OUT_OF_RANGE, \"Value -9223372036854775808 is out of range for abs(bigint)\");\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_72 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBuildGlueExpressionTupleDomainNotNull()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addDomain(\"col1\", Domain.notNull(VarcharType.VARCHAR))\n .build();\n String expression = buildGlueExpression(ImmutableList.o... | {
"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_554 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private MemoryMetadata metadata;",
"type": "MemoryMetadata",
"var_name": "metadata"
}
],
"file": "presto-memory/src/test/java/io/prestosql/plugin/memory/TestMemoryMetadata.java",
"identifie... | {
"body": "@Test\n public void testRenameTable()\n {\n SchemaTableName tableName = new SchemaTableName(\"test_schema\", \"test_table_to_be_renamed\");\n metadata.createSchema(SESSION, \"test_schema\", ImmutableMap.of(), new PrestoPrincipal(USER, SESSION.getUser()));\n ConnectorOutputTableHa... | {
"fields": [
{
"declarator": "SCHEMA_NAME = \"default\"",
"modifier": "public static final",
"original_string": "public static final String SCHEMA_NAME = \"default\";",
"type": "String",
"var_name": "SCHEMA_NAME"
},
{
"declarator": "nodeManager",
"modifier": "pri... | {
"body": "@Override\n public synchronized void renameTable(ConnectorSession session, ConnectorTableHandle tableHandle, SchemaTableName newTableName)\n {\n checkSchemaExists(newTableName.getSchemaName());\n checkTableNotExists(newTableName);\n\n MemoryTableHandle handle = (MemoryTableHandle... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_104 | {
"fields": [
{
"declarator": "DEFAULT_CLIENT = createFakeMetastoreClient()",
"modifier": "private static final",
"original_string": "private static final ThriftMetastoreClient DEFAULT_CLIENT = createFakeMetastoreClient();",
"type": "ThriftMetastoreClient",
"var_name": "DEFAULT_CLIEN... | {
"body": "@Test\n public void testFallbackHiveMetastore()\n throws TException\n {\n MetastoreLocator locator = createMetastoreLocator(CONFIG_WITH_FALLBACK, ImmutableMap.of(DEFAULT_URI, Optional.empty(), FALLBACK_URI, Optional.of(FALLBACK_CLIENT)));\n assertEqualHiveClient(locator.creat... | {
"fields": [
{
"declarator": "addresses",
"modifier": "private final",
"original_string": "private final List<HostAndPort> addresses;",
"type": "List<HostAndPort>",
"var_name": "addresses"
},
{
"declarator": "backoffs",
"modifier": "private final",
"origina... | {
"body": "@Override\n public ThriftMetastoreClient createMetastoreClient(Optional<String> delegationToken)\n throws TException\n {\n List<Integer> indices = backoffs.stream()\n .sorted(Comparator.comparingLong(Backoff::getBackoffDuration))\n .map(backoffs::indexO... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_391 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testLineLocatePoint()\n {\n assertFunction(\"line_locate_point(ST_GeometryFromText('LINESTRING (0 0, 0 1)'), ST_Point(0, 0.2))\", DOUBLE, 0.2);\n assertFunction(\"line_locate_point(ST_GeometryFromText('LINESTRING (0 0, 0 1)'), ST_Point(0, 0))\", DOUBLE, 0.0);\n ... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@SqlNullable\n @Description(\"Returns a float between 0 and 1 representing the location of the closest point on the LineString to the given Point, as a fraction of total 2d line length.\")\n @ScalarFunction(\"line_locate_point\")\n @SqlType(DOUBLE)\n public static Double lineLocatePoint(@SqlTyp... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"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.