id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
166515022_459
{ "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 testShiftRightMultiPrecision()\n {\n assertEquals(shiftRightMultiPrecision(\n new int[] {0b10100001010001011010000101000101, 0b01010110100101101011010101010101, 0b01010010111110001111100010101010,\n 0b11111111000000011010101010101011, 0...
{ "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 int[] shiftRightMultiPrecision(int[] number, int length, int shifts)\n {\n if (shifts == 0) {\n return number;\n }\n // wordShifts = shifts / 32\n int wordShifts = shifts >>> 5;\n // we don't wan't to loose any trailing bits\n for (int i = 0; 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_1190
{ "fields": [ { "declarator": "TASK_INSTANCE_ID = \"task-instance-id\"", "modifier": "private static final", "original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";", "type": "String", "var_name": "TASK_INSTANCE_ID" }, { "declarator": "T...
{ "body": "@Test\n public void testReferenceCount()\n {\n ClientBuffer buffer = new ClientBuffer(TASK_INSTANCE_ID, BUFFER_ID);\n\n // add 2 pages and verify they are referenced\n AtomicBoolean page0HasReference = addPage(buffer, createPage(0));\n AtomicBoolean page1HasReference = add...
{ "fields": [ { "declarator": "taskInstanceId", "modifier": "private final", "original_string": "private final String taskInstanceId;", "type": "String", "var_name": "taskInstanceId" }, { "declarator": "bufferId", "modifier": "private final", "original_strin...
{ "body": "public void destroy()\n {\n List<SerializedPageReference> removedPages;\n PendingRead pendingRead;\n synchronized (this) {\n removedPages = ImmutableList.copyOf(pages);\n pages.clear();\n\n bufferedBytes.getAndSet(0);\n\n noMorePages = tru...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_770
{ "fields": [ { "declarator": "executor", "modifier": "private", "original_string": "private ExecutorService executor;", "type": "ExecutorService", "var_name": "executor" }, { "declarator": "scheduledExecutor", "modifier": "private", "original_string": "priv...
{ "body": "@Test(dataProvider = \"hashEnabledValues\")\n public void testSemiJoin(boolean hashEnabled)\n {\n DriverContext driverContext = taskContext.addPipelineContext(0, true, true, false).addDriverContext();\n\n // build\n OperatorContext operatorContext = driverContext.addOperatorConte...
{ "fields": [ { "declarator": "pages", "modifier": "private final", "original_string": "private final WorkProcessor<Page> pages;", "type": "WorkProcessor<Page>", "var_name": "pages" } ], "file": "presto-main/src/main/java/io/prestosql/operator/HashSemiJoinOperator.java", "i...
{ "body": "public static OperatorFactory createOperatorFactory(\n int operatorId,\n PlanNodeId planNodeId,\n SetSupplier setSupplier,\n List<? extends Type> probeTypes,\n int probeJoinChannel,\n Optional<Integer> probeJoinHashChannel)\n {\n r...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_320
{ "fields": [ { "declarator": "NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\")", "modifier": "private static final", "original_string": "private static final ExampleTableHandle NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\");", "type": "Examp...
{ "body": "@Test\n public void testGetColumnHandles()\n {\n // known table\n assertEquals(metadata.getColumnHandles(SESSION, NUMBERS_TABLE_HANDLE), ImmutableMap.of(\n \"text\", new ExampleColumnHandle(\"text\", createUnboundedVarcharType(), 0),\n \"value\", new Exampl...
{ "fields": [ { "declarator": "exampleClient", "modifier": "private final", "original_string": "private final ExampleClient exampleClient;", "type": "ExampleClient", "var_name": "exampleClient" } ], "file": "presto-example-http/src/main/java/io/prestosql/plugin/example/Exampl...
{ "body": "@Override\n public Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle)\n {\n ExampleTableHandle exampleTableHandle = (ExampleTableHandle) tableHandle;\n\n ExampleTable table = exampleClient.getTable(exampleTableHandle.getSchemaName(), e...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_635
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/spiller/TestAesSpillCipher.java", "identifier": "TestAesSpillCipher", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test()\n {\n AesSpillCipher spillCipher = new AesSpillCipher();\n // test [0, 257] buffer sizes to check off all padding cases\n for (int size = 0; size <= 257; size++) {\n byte[] data = randomBytes(size);\n // .clone() to prevent cipher ...
{ "fields": [ { "declarator": "CIPHER_NAME = \"AES/CBC/PKCS5Padding\"", "modifier": "private static final", "original_string": "private static final String CIPHER_NAME = \"AES/CBC/PKCS5Padding\";", "type": "String", "var_name": "CIPHER_NAME" }, { "declarator": "KEY_BITS...
{ "body": "@Override\n public void close()\n {\n /*\n * Setting the {@link AesSpillCipher#key} to null allows the key to be reclaimed by GC at the time of\n * destruction, even if the {@link AesSpillCipher} itself is still reachable for longer. When the key\n * is null, subsequent...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_265
{ "fields": [ { "declarator": "DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC)", "modifier": "private static final", "original_string": "private static final DateTime DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC);", "type": "DateTime", "var_name": "DATE_TIME" } ], "fi...
{ "body": "@Test\n public void testTimestampBlock()\n {\n BlockBuilder blockBuilder = TIMESTAMP_MILLIS.createBlockBuilder(null, 4);\n\n // start and end of UTC day\n TIMESTAMP_MILLIS.writeLong(blockBuilder, DATE_TIME.getMillis() * MICROSECONDS_PER_MILLISECOND);\n TIMESTAMP_MILLIS.wri...
{ "fields": [], "file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/organization/TemporalFunction.java", "identifier": "TemporalFunction", "interfaces": "", "methods": [ { "class_method_signature": "TemporalFunction.TemporalFunction()", "constructor": true, ...
{ "body": "public static int getDay(Type type, Block block, int position)\n {\n if (type.equals(DATE)) {\n return toIntExact(DATE.getLong(block, position));\n }\n\n if (type.equals(TIMESTAMP_MILLIS)) {\n long days = floorDiv(TIMESTAMP_MILLIS.getLong(block, position), MICR...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_971
{ "fields": [ { "declarator": "zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) -> new LongLiteral(\"0\"))", "modifier": "private", "original_string": "private ExpressionRewriteRuleSet zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) ...
{ "body": "@Test\n public void testFilterExpressionNotRewritten()\n {\n tester().assertThat(zeroRewriter.filterExpressionRewrite())\n .on(p -> p.filter(new LongLiteral(\"0\"), p.values()))\n .doesNotFire();\n }", "class_method_signature": "TestExpressionRewriteRuleSet.t...
{ "fields": [ { "declarator": "rewriter", "modifier": "private final", "original_string": "private final ExpressionRewriter rewriter;", "type": "ExpressionRewriter", "var_name": "rewriter" } ], "file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/Express...
{ "body": "public Rule<?> filterExpressionRewrite()\n {\n return new FilterExpressionRewrite(rewriter);\n }", "class_method_signature": "ExpressionRewriteRuleSet.filterExpressionRewrite()", "constructor": false, "full_signature": "public Rule<?> filterExpressionRewrite()", "identifier": "filterEx...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_588
{ "fields": [ { "declarator": "database", "modifier": "private", "original_string": "private TestingDatabase database;", "type": "TestingDatabase", "var_name": "database" }, { "declarator": "jdbcClient", "modifier": "private", "original_string": "private Jdb...
{ "body": "@Test\n public void testCursorMixedOrder()\n {\n RecordSet recordSet = createRecordSet(ImmutableList.of(\n columnHandles.get(\"value\"),\n columnHandles.get(\"value\"),\n columnHandles.get(\"text\")));\n\n try (RecordCursor cursor = recordSet...
{ "fields": [ { "declarator": "jdbcClient", "modifier": "private final", "original_string": "private final JdbcClient jdbcClient;", "type": "JdbcClient", "var_name": "jdbcClient" }, { "declarator": "table", "modifier": "private final", "original_string": "pr...
{ "body": "@Override\n public RecordCursor cursor()\n {\n return new JdbcRecordCursor(jdbcClient, session, split, table, columnHandles);\n }", "class_method_signature": "JdbcRecordSet.cursor()", "constructor": false, "full_signature": "@Override public RecordCursor cursor()", "identifier": "cu...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_422
{ "fields": [], "file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java", "identifier": "TestGeoFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testSTInteriorRingN()\n {\n assertInvalidInteriorRingN(\"POINT EMPTY\", 0, \"POINT\");\n assertInvalidInteriorRingN(\"LINESTRING (1 2, 2 3, 3 4)\", 1, \"LINE_STRING\");\n assertInvalidInteriorRingN(\"MULTIPOINT (1 1, 2 3, 5 8)\", -1, \"MULTI_POINT\");\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 the interior ring element at the specified index (indices start at 1)\")\n @ScalarFunction(\"ST_InteriorRingN\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stInteriorRingN(@SqlType(GEOMETRY_TYPE_NAME) Slice input, @SqlType(INTEGER) long index)\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_137
{ "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 testCalculateRangeForPartitioningKey()\n {\n assertEquals(\n calculateRangeForPartitioningKey(\n PARTITION_COLUMN_1,\n VARCHAR,\n ImmutableList.of(partition(\"p1=string1/p2=1234\"))),\n ...
{ "fields": [ { "declarator": "log = Logger.get(MetastoreHiveStatisticsProvider.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(MetastoreHiveStatisticsProvider.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n static Optional<DoubleRange> calculateRangeForPartitioningKey(HiveColumnHandle column, Type type, List<HivePartition> partitions)\n {\n List<OptionalDouble> convertedValues = partitions.stream()\n .map(HivePartition::getKeys)\n .map(keys -> ke...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_567
{ "fields": [], "file": "presto-base-jdbc/src/test/java/io/prestosql/plugin/jdbc/TestTypeHandlingJdbcConfig.java", "identifier": "TestTypeHandlingJdbcConfig", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(TypeHandlingJdbcConfig.class)\n .setUnsupportedTypeHandling(UnsupportedTypeHandling.IGNORE));\n }", "class_method_signature": "TestTypeHandlingJdbcConfig.testDefaults()", "constructor": false, ...
{ "fields": [ { "declarator": "unsupportedTypeHandling = UnsupportedTypeHandling.IGNORE", "modifier": "private", "original_string": "private UnsupportedTypeHandling unsupportedTypeHandling = UnsupportedTypeHandling.IGNORE;", "type": "UnsupportedTypeHandling", "var_name": "unsupported...
{ "body": "@Config(\"unsupported-type-handling\")\n @LegacyConfig(\"unsupported-type.handling-strategy\")\n @ConfigDescription(\"Unsupported type handling strategy\")\n public TypeHandlingJdbcConfig setUnsupportedTypeHandling(UnsupportedTypeHandling unsupportedTypeHandling)\n {\n this.unsupportedTy...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_41
{ "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 testSchemaOperations()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"catalog.json\");\n\n PrestoPrincipal user = new PrestoPrincipal(PrincipalType.USER, \"some_user\");\n PrestoPrincipal role = new PrestoPrincipal(PrincipalType.RO...
{ "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 checkCanSetSchemaAuthorization(SystemSecurityContext context, CatalogSchemaName schema, PrestoPrincipal principal)\n {\n if (!isSchemaOwner(context, schema)) {\n denySetSchemaAuthorization(schema.toString(), principal);\n }\n }", "class_method_sig...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_834
{ "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 testRound()\n {\n assertFunction(\"round(TINYINT '3')\", TINYINT, (byte) 3);\n assertFunction(\"round(TINYINT '-3')\", TINYINT, (byte) -3);\n assertFunction(\"round(CAST(NULL as TINYINT))\", TINYINT, null);\n assertFunction(\"round(SMALLINT '3')\", SMAL...
{ "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(\"Round to nearest integer\")\n @ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long round(@SqlType(StandardTypes.BIGINT) long num)\n {\n return num;\n }", "class_method_signature": "MathFunctions.round(@SqlType(StandardTypes.BIGINT) long num)", "cons...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1104
{ "fields": [ { "declarator": "TEST_HEADERS = new GuavaMultivaluedMap<>(ImmutableListMultimap.<String, String>builder()\n .put(PRESTO_USER, \"testUser\")\n .put(PRESTO_SOURCE, \"testSource\")\n .put(PRESTO_CATALOG, \"testCatalog\")\n .put(PRESTO_SCHEMA, \"testSche...
{ "body": "@Test\n public void testCatalogAndSchemaOverrides()\n {\n // none specified\n Session session = createSession(\n ImmutableListMultimap.<String, String>builder()\n .put(PRESTO_USER, \"testUser\")\n .put(PRESTO_CATALOG, \"catalo...
{ "fields": [ { "declarator": "transactionManager", "modifier": "private final", "original_string": "private final TransactionManager transactionManager;", "type": "TransactionManager", "var_name": "transactionManager" }, { "declarator": "accessControl", "modifier...
{ "body": "@Override\n public Session createSession(QueryId queryId, SessionContext context)\n {\n Identity identity = context.getIdentity();\n accessControl.checkCanSetUser(identity.getPrincipal(), identity.getUser());\n\n // authenticated identity is not present for HTTP or if authenticat...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1041
{ "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 testMultipleWithListEntries()\n {\n analyze(\"WITH a(x) AS (SELECT 1),\" +\n \" b(y) AS (SELECT x + 1 FROM a),\" +\n \" c(z) AS (SELECT y * 10 FROM b)\" +\n \"SELECT * FROM a, b, c\");\n\n analyze(\"WITH RECURSIVE a(x)...
{ "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_475
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestAllOrNoneValueSet.java", "identifier": "TestAllOrNoneValueSet", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNone()\n {\n AllOrNoneValueSet valueSet = AllOrNoneValueSet.none(HYPER_LOG_LOG);\n assertEquals(valueSet.getType(), HYPER_LOG_LOG);\n assertTrue(valueSet.isNone());\n assertFalse(valueSet.isAll());\n assertFalse(valueSet.isSingleValue());\n ...
{ "fields": [ { "declarator": "type", "modifier": "private final", "original_string": "private final Type type;", "type": "Type", "var_name": "type" }, { "declarator": "all", "modifier": "private final", "original_string": "private final boolean all;", ...
{ "body": "static AllOrNoneValueSet none(Type type)\n {\n return new AllOrNoneValueSet(type, false);\n }", "class_method_signature": "AllOrNoneValueSet.none(Type type)", "constructor": false, "full_signature": "static AllOrNoneValueSet none(Type type)", "identifier": "none", "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_926
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java", "identifier": "TestLogicalPlanner", "interfaces": "", "superclass": "extends BasePlanTest" }
{ "body": "@Test\n public void testSameInSubqueryIsAppliedOnlyOnce()\n {\n // same IN query used for left, right and complex condition\n assertEquals(\n countOfMatchingNodes(\n plan(\"SELECT * FROM orders o1 JOIN orders o2 ON o1.orderkey IN (SELECT 1) AND (o1....
{ "fields": [ { "declarator": "idAllocator", "modifier": "private final", "original_string": "private final PlanNodeIdAllocator idAllocator;", "type": "PlanNodeIdAllocator", "var_name": "idAllocator" }, { "declarator": "session", "modifier": "private final", ...
{ "body": "public Plan plan(Analysis analysis)\n {\n return plan(analysis, OPTIMIZED_AND_VALIDATED);\n }", "class_method_signature": "LogicalPlanner.plan(Analysis analysis)", "constructor": false, "full_signature": "public Plan plan(Analysis analysis)", "identifier": "plan", "invocations": [ ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_16
{ "fields": [], "file": "presto-plugin-toolkit/src/test/java/io/prestosql/plugin/base/util/TestJsonUtils.java", "identifier": "TestJsonUtils", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLowercaseEnum()\n throws IOException\n {\n TestObject parsed = parseJson(\"{\\\"testEnum\\\": \\\"option_a\\\"}\".getBytes(US_ASCII), TestObject.class);\n assertThat(parsed.testEnum).isEqualTo(OPTION_A);\n }", "class_method_signature": "TestJsonUt...
{ "fields": [], "file": "presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/util/JsonUtils.java", "identifier": "JsonUtils", "interfaces": "", "methods": [ { "class_method_signature": "JsonUtils.JsonUtils()", "constructor": true, "full_signature": "private JsonUtils()", ...
{ "body": "public static <T> T parseJson(Path path, Class<T> javaType)\n {\n if (!path.isAbsolute()) {\n path = path.toAbsolutePath();\n }\n\n checkArgument(exists(path), \"File does not exist: %s\", path);\n checkArgument(isReadable(path), \"File is not readable: %s\", path)...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_863
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java", "identifier": "TestStringFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testReverse()\n {\n assertFunction(\"REVERSE('')\", createVarcharType(0), \"\");\n assertFunction(\"REVERSE('hello')\", createVarcharType(5), \"olleh\");\n assertFunction(\"REVERSE('Quadratically')\", createVarcharType(13), \"yllacitardauQ\");\n assertF...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java", "identifier": "StringFunctions", "interfaces": "", "methods": [ { "class_method_signature": "StringFunctions.StringFunctions()", "constructor": true, "full_signature": "private StringF...
{ "body": "@Description(\"Reverse all code points in a given string\")\n @ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice reverse(@SqlType(\"varchar(x)\") Slice slice)\n {\n return SliceUtf8.reverse(slice);\n }", "class_method_signature": "StringF...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_530
{ "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 testUserRegex()\n {\n ResourceGroupId resourceGroupId = new ResourceGroupId(new ResourceGroupId(\"global\"), \"foo\");\n StaticSelector selector = new StaticSelector(\n Optional.of(Pattern.compile(\"user.*\")),\n Optional.empty(),\n ...
{ "fields": [ { "declarator": "NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\")", "modifier": "private static final", "original_string": "private static final Pattern NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\");", "type": "Pa...
{ "body": "@Override\n public Optional<SelectionContext<ResourceGroupIdTemplate>> match(SelectionCriteria criteria)\n {\n Map<String, String> variables = new HashMap<>();\n\n if (userRegex.isPresent()) {\n Matcher userMatcher = userRegex.get().matcher(criteria.getUser());\n i...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_160
{ "fields": [ { "declarator": "blockEncodingSerde = createTestMetadataManager().getBlockEncodingSerde()", "modifier": "private final", "original_string": "private final BlockEncodingSerde blockEncodingSerde = createTestMetadataManager().getBlockEncodingSerde();", "type": "BlockEncodingSerd...
{ "body": "@Test\n public void testReuse()\n {\n BytesWritable value = new BytesWritable();\n\n byte[] first = \"hello world\".getBytes(UTF_8);\n value.set(first, 0, first.length);\n\n byte[] second = \"bye\".getBytes(UTF_8);\n value.set(second, 0, second.length);\n\n T...
{ "fields": [], "file": "presto-hive/src/main/java/io/prestosql/plugin/hive/util/SerDeUtils.java", "identifier": "SerDeUtils", "interfaces": "", "methods": [ { "class_method_signature": "SerDeUtils.SerDeUtils()", "constructor": true, "full_signature": "private SerDeUtils()", "iden...
{ "body": "public static Block getBlockObject(Type type, Object object, ObjectInspector objectInspector)\n {\n Block block = serializeObject(type, null, object, objectInspector);\n return requireNonNull(block, \"serialized result is null\");\n }", "class_method_signature": "SerDeUtils.getBlockOb...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1153
{ "fields": [ { "declarator": "STAGE_ID = new StageId(\"query\", 0)", "modifier": "private static final", "original_string": "private static final StageId STAGE_ID = new StageId(\"query\", 0);", "type": "StageId", "var_name": "STAGE_ID" }, { "declarator": "LOCATION = UR...
{ "body": "@Test\n public void testFailed()\n {\n StageStateMachine stateMachine = createStageStateMachine();\n\n assertTrue(stateMachine.transitionToFailed(FAILED_CAUSE));\n assertFinalState(stateMachine, StageState.FAILED);\n }", "class_method_signature": "TestStageStateMachine.testF...
{ "fields": [ { "declarator": "log = Logger.get(StageStateMachine.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(StageStateMachine.class);", "type": "Logger", "var_name": "log" }, { "declarator": "stageId", ...
{ "body": "public boolean transitionToFailed(Throwable throwable)\n {\n requireNonNull(throwable, \"throwable is null\");\n\n failureCause.compareAndSet(null, Failures.toFailure(throwable));\n boolean failed = stageState.setIf(FAILED, currentState -> !currentState.isDone());\n if (faile...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_249
{ "fields": [ { "declarator": "dbi", "modifier": "private", "original_string": "private IDBI dbi;", "type": "IDBI", "var_name": "dbi" }, { "declarator": "dummyHandle", "modifier": "private", "original_string": "private Handle dummyHandle;", "type": "Ha...
{ "body": "@Test(invocationCount = 20)\n public void testEjector()\n throws Exception\n {\n NodeManager nodeManager = createNodeManager(\"node1\", \"node2\", \"node3\", \"node4\", \"node5\");\n\n ShardEjector ejector = new ShardEjector(\n nodeManager.getCurrentNode().getN...
{ "fields": [ { "declarator": "log = Logger.get(ShardEjector.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(ShardEjector.class);", "type": "Logger", "var_name": "log" }, { "declarator": "currentNode", ...
{ "body": "@VisibleForTesting\n void process()\n {\n checkState(backupStore.isPresent(), \"backup store must be present\");\n\n // get the size of assigned shards for each node\n Map<String, Long> nodes = shardManager.getNodeBytes();\n\n Set<String> activeNodes = nodeSupplier.getWork...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_619
{ "fields": [ { "declarator": "HASH_TABLE_SIZE = 10000", "modifier": "private static final", "original_string": "private static final int HASH_TABLE_SIZE = 10000;", "type": "int", "var_name": "HASH_TABLE_SIZE" }, { "declarator": "SIMULATION_ACCURACY = 0.05", "modi...
{ "body": "@Test\n public void hashEstimatesShouldIncrease()\n {\n assertEquals(estimateNumberOfHashCollisions(0, 100), 0d);\n for (int i = 1; i <= HASH_TABLE_SIZE; ++i) {\n assertTrue(estimateNumberOfHashCollisions(i - 1, HASH_TABLE_SIZE) < estimateNumberOfHashCollisions(i, HASH_TABLE_...
{ "fields": [ { "declarator": "NUMBER_OF_ESTIMATES = 500", "modifier": "private static final", "original_string": "private static final int NUMBER_OF_ESTIMATES = 500;", "type": "int", "var_name": "NUMBER_OF_ESTIMATES" }, { "declarator": "NUMBER_OF_VALUES = 10000", ...
{ "body": "public static double estimateNumberOfHashCollisions(int numberOfValues, int hashSize)\n {\n checkState(0 <= numberOfValues && numberOfValues <= hashSize);\n\n if (hashSize == 0) {\n return 0d;\n }\n\n double estimateRescaleFactor = (double) numberOfValues / NUMBER_...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1016
{ "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 testGroupByWithSubquerySelectExpressionWithDereferenceExpression()\n {\n analyze(\"SELECT (SELECT t.a.someField) \" +\n \"FROM (VALUES ROW(CAST(ROW(1) AS ROW(someField BIGINT)), 2)) t(a, b) \" +\n \"GROUP BY a\");\n\n assertFails(\"SELEC...
{ "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_930
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java", "identifier": "TestLogicalPlanner", "interfaces": "", "superclass": "extends BasePlanTest" }
{ "body": "@Test\n public void testRemoveSingleRowSort()\n {\n String query = \"SELECT count(*) FROM orders ORDER BY 1\";\n assertFalse(\n searchFrom(plan(query, OPTIMIZED).getRoot())\n .where(isInstanceOfAny(SortNode.class))\n .matches(...
{ "fields": [ { "declarator": "idAllocator", "modifier": "private final", "original_string": "private final PlanNodeIdAllocator idAllocator;", "type": "PlanNodeIdAllocator", "var_name": "idAllocator" }, { "declarator": "session", "modifier": "private final", ...
{ "body": "public Plan plan(Analysis analysis)\n {\n return plan(analysis, OPTIMIZED_AND_VALIDATED);\n }", "class_method_signature": "LogicalPlanner.plan(Analysis analysis)", "constructor": false, "full_signature": "public Plan plan(Analysis analysis)", "identifier": "plan", "invocations": [ ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1283
{ "fields": [ { "declarator": "TEST_METADATA_SHEET_ID = \"1Es4HhWALUQjoa-bQh4a8B5HROz7dpGMfq_HbfoaW5LM#Tables\"", "modifier": "static final", "original_string": "static final String TEST_METADATA_SHEET_ID = \"1Es4HhWALUQjoa-bQh4a8B5HROz7dpGMfq_HbfoaW5LM#Tables\";", "type": "String", ...
{ "body": "@Test\n public void testCreateConnector()\n throws Exception\n {\n Plugin plugin = new SheetsPlugin();\n ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());\n Builder<String, String> propertiesMap = new Builder<String, String>().put(\"credentials...
{ "fields": [], "file": "presto-google-sheets/src/main/java/io/prestosql/plugin/google/sheets/SheetsPlugin.java", "identifier": "SheetsPlugin", "interfaces": "implements Plugin", "methods": [ { "class_method_signature": "SheetsPlugin.getConnectorFactories()", "constructor": false, "full_...
{ "body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new SheetsConnectorFactory());\n }", "class_method_signature": "SheetsPlugin.getConnectorFactories()", "constructor": false, "full_signature": "@Override public Iterable<ConnectorFactor...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_199
{ "fields": [ { "declarator": "forReal", "modifier": "private", "original_string": "private boolean forReal;", "type": "boolean", "var_name": "forReal" }, { "declarator": "successResponse = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><soapenv:Envelope xmlns:soap...
{ "body": "@Test(expectedExceptions = AccessDeniedException.class, description = \"Test bad password for real, yo!\")\n void createAuthenticatedPrincipalRealBadPassword()\n {\n // Skip this test if SALESFORCE_TEST_FORREAL is not set to TRUE.\n if (!forReal) {\n throw new SkipException(\...
{ "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_463
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/type/TestVarchars.java", "identifier": "TestVarchars", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testByteCount()\n {\n // Single byte code points\n assertByteCount(\"abc\", 0, 0, 1, \"\");\n assertByteCount(\"abc\", 0, 1, 0, \"\");\n assertByteCount(\"abc\", 1, 1, 1, \"b\");\n assertByteCount(\"abc\", 1, 1, 2, \"b\");\n assertByteCoun...
{ "fields": [], "file": "presto-spi/src/main/java/io/prestosql/spi/type/Varchars.java", "identifier": "Varchars", "interfaces": "", "methods": [ { "class_method_signature": "Varchars.Varchars()", "constructor": true, "full_signature": "private Varchars()", "identifier": "Varchars"...
{ "body": "public static int byteCount(Slice slice, int offset, int length, int codePointCount)\n {\n requireNonNull(slice, \"slice is null\");\n if (length < 0) {\n throw new IllegalArgumentException(\"length must be greater than or equal to zero\");\n }\n if (offset < 0 || ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_176
{ "fields": [ { "declarator": "BUCKET_COUNT = 2", "modifier": "private static final", "original_string": "private static final int BUCKET_COUNT = 2;", "type": "int", "var_name": "BUCKET_COUNT" }, { "declarator": "TIMESTAMP_PRECISION = 3", "modifier": "private stat...
{ "body": "@Test\n public void testGetBucketNumber()\n {\n // legacy Presto naming pattern\n assertEquals(getBucketNumber(\"20190526_072952_00009_fn7s5_bucket-00234\"), OptionalInt.of(234));\n assertEquals(getBucketNumber(\"20190526_072952_00009_fn7s5_bucket-00234.txt\"), OptionalInt.of(234...
{ "fields": [ { "declarator": "BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\")", "modifier": "private static final", "original_string": "private static final Pattern BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\"...
{ "body": "@VisibleForTesting\n static OptionalInt getBucketNumber(String name)\n {\n for (Pattern pattern : BUCKET_PATTERNS) {\n Matcher matcher = pattern.matcher(name);\n if (matcher.matches()) {\n return OptionalInt.of(parseInt(matcher.group(1)));\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_526
{ "fields": [ { "declarator": "QUERY_RESULTS_CODEC = jsonCodec(QueryResults.class)", "modifier": "private static final", "original_string": "private static final JsonCodec<QueryResults> QUERY_RESULTS_CODEC = jsonCodec(QueryResults.class);", "type": "JsonCodec<QueryResults>", "var_nam...
{ "body": "@Test\n public void testCookie()\n throws Exception\n {\n server.enqueue(new MockResponse()\n .setResponseCode(307)\n .addHeader(LOCATION, server.url(\"/v1/statement\"))\n .addHeader(SET_COOKIE, \"a=apple\"));\n server.enqueue(new ...
{ "fields": [ { "declarator": "log = Logger.get(QueryRunner.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(QueryRunner.class);", "type": "Logger", "var_name": "log" }, { "declarator": "session", "modif...
{ "body": "public Query startQuery(String query)\n {\n return new Query(startInternalQuery(session.get(), query), debug);\n }", "class_method_signature": "QueryRunner.startQuery(String query)", "constructor": false, "full_signature": "public Query startQuery(String query)", "identifier": "startQu...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_875
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java", "identifier": "TestStringFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testLower()\n {\n assertFunction(\"LOWER('')\", createVarcharType(0), \"\");\n assertFunction(\"LOWER('Hello World')\", createVarcharType(11), \"hello world\");\n assertFunction(\"LOWER('WHAT!!')\", createVarcharType(6), \"what!!\");\n assertFunction(\"...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java", "identifier": "StringFunctions", "interfaces": "", "methods": [ { "class_method_signature": "StringFunctions.StringFunctions()", "constructor": true, "full_signature": "private StringF...
{ "body": "@Description(\"Converts the string to lower case\")\n @ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(\"varchar(x)\")\n public static Slice lower(@SqlType(\"varchar(x)\") Slice slice)\n {\n return toLowerCase(slice);\n }", "class_method_signature": "StringFunctions.lower(@...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1145
{ "fields": [ { "declarator": "SQL_PARSER = new SqlParser()", "modifier": "private static final", "original_string": "private static final SqlParser SQL_PARSER = new SqlParser();", "type": "SqlParser", "var_name": "SQL_PARSER" }, { "declarator": "QUERY_PREPARER = new Qu...
{ "body": "@Test\n public void testParameterMismatchWithLimit()\n {\n Session session = testSessionBuilder()\n .addPreparedStatement(\"my_query\", \"SELECT ? FROM foo LIMIT ?\")\n .build();\n assertPrestoExceptionThrownBy(() -> QUERY_PREPARER.prepareQuery(session, \"E...
{ "fields": [ { "declarator": "sqlParser", "modifier": "private final", "original_string": "private final SqlParser sqlParser;", "type": "SqlParser", "var_name": "sqlParser" } ], "file": "presto-main/src/main/java/io/prestosql/execution/QueryPreparer.java", "identifier": "Q...
{ "body": "public PreparedQuery prepareQuery(Session session, String query)\n throws ParsingException, PrestoException\n {\n Statement wrappedStatement = sqlParser.createStatement(query, createParsingOptions(session));\n return prepareQuery(session, wrappedStatement);\n }", "class_met...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1000
{ "fields": [ { "declarator": "metadata = MetadataManager.createTestMetadataManager()", "modifier": "private final", "original_string": "private final Metadata metadata = MetadataManager.createTestMetadataManager();", "type": "Metadata", "var_name": "metadata" } ], "file": "p...
{ "body": "@Test\n public void testInteger()\n {\n List<RowExpression> values = new ArrayList<>();\n values.add(constant(Integer.MIN_VALUE, INTEGER));\n values.add(constant(Integer.MAX_VALUE, INTEGER));\n values.add(constant(3, INTEGER));\n assertEquals(checkSwitchGenerationCa...
{ "fields": [ { "declarator": "valueExpression", "modifier": "private final", "original_string": "private final RowExpression valueExpression;", "type": "RowExpression", "var_name": "valueExpression" }, { "declarator": "testExpressions", "modifier": "private final...
{ "body": "@VisibleForTesting\n static SwitchGenerationCase checkSwitchGenerationCase(Type type, List<RowExpression> values)\n {\n if (values.size() > 32) {\n // 32 is chosen because\n // * SET_CONTAINS performs worst when smaller than but close to power of 2\n // * Bench...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_434
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/type/TestChars.java", "identifier": "TestChars", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPadSpaces()\n {\n String nonBmp = \"\\uD83D\\uDE81\"; // surrogate pair\n verify(nonBmp.codePoints().count() == 1, \"nonBmp must be a single character (code point) string\");\n verify(nonBmp.length() == 2, \"nonBmp must be encoded as surrogate pairs (2 Jav...
{ "fields": [], "file": "presto-spi/src/main/java/io/prestosql/spi/type/Chars.java", "identifier": "Chars", "interfaces": "", "methods": [ { "class_method_signature": "Chars.Chars()", "constructor": true, "full_signature": "private Chars()", "identifier": "Chars", "modifiers...
{ "body": "public static Slice padSpaces(Slice slice, CharType charType)\n {\n requireNonNull(charType, \"charType is null\");\n return padSpaces(slice, charType.getLength());\n }", "class_method_signature": "Chars.padSpaces(Slice slice, CharType charType)", "constructor": false, "full_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_967
{ "fields": [ { "declarator": "zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) -> new LongLiteral(\"0\"))", "modifier": "private", "original_string": "private ExpressionRewriteRuleSet zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) ...
{ "body": "@Test\n public void testProjectionExpressionNotRewritten()\n {\n tester().assertThat(zeroRewriter.projectExpressionRewrite())\n .on(p -> p.project(\n Assignments.of(p.symbol(\"y\"), PlanBuilder.expression(\"0\")),\n p.values(p.symbol...
{ "fields": [ { "declarator": "rewriter", "modifier": "private final", "original_string": "private final ExpressionRewriter rewriter;", "type": "ExpressionRewriter", "var_name": "rewriter" } ], "file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/Express...
{ "body": "public Rule<?> projectExpressionRewrite()\n {\n return new ProjectExpressionRewrite(rewriter);\n }", "class_method_signature": "ExpressionRewriteRuleSet.projectExpressionRewrite()", "constructor": false, "full_signature": "public Rule<?> projectExpressionRewrite()", "identifier": "proj...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_988
{ "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 testWindow()\n {\n PlanNode node = new WindowNode(\n newId(),\n filter(\n baseTableScan,\n and(\n equals(AE, BE),\n equals(BE, CE),\n ...
{ "fields": [ { "declarator": "SYMBOL_MATCHES_EXPRESSION =\n entry -> entry.getValue().equals(entry.getKey().toSymbolReference())", "modifier": "private static final", "original_string": "private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION...
{ "body": "public Expression extract(Session session, PlanNode node, TypeProvider types, TypeAnalyzer typeAnalyzer)\n {\n return node.accept(new Visitor(domainTranslator, metadata, session, types, typeAnalyzer, useTableProperties), null);\n }", "class_method_signature": "EffectivePredicateExtractor.ext...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_822
{ "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 testLog10()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"log10(\" + doubleValue + \")\", DOUBLE, Math.log10(doubleValue));\n }\n assertFunction(\"log10(NULL)\", DOUBLE, null);\n }", "class_method_signature": "TestMathFunc...
{ "fields": [ { "declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()", "modifier": "public static final", "original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();", "type": "SqlScalarFunction", "var_name": "DECIMAL_MOD_FUNCTION" ...
{ "body": "@Description(\"Logarithm to base 10\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double log10(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.log10(num);\n }", "class_method_signature": "MathFunctions.log10(@SqlType(StandardTypes.DOUBLE) 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_57
{ "fields": [ { "declarator": "typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators())", "modifier": "private final", "original_string": "private final TypeManager typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators());", "ty...
{ "body": "@Test\n public void testBuildSQL()\n {\n IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(typeManager);\n List<HiveColumnHandle> columns = ImmutableList.of(\n createBaseColumn(\"n_nationkey\", 0, HIVE_INT, INTEGER, REGULAR, Optional.empty()),\n crea...
{ "fields": [ { "declarator": "FORMATTER = date().withChronology(getInstanceUTC())", "modifier": "private static final", "original_string": "private static final DateTimeFormatter FORMATTER = date().withChronology(getInstanceUTC());", "type": "DateTimeFormatter", "var_name": "FORMATT...
{ "body": "public String buildSql(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> tupleDomain)\n {\n columns.forEach(column -> checkArgument(column.isBaseColumn(), \"%s is not a base column\", column));\n tupleDomain.getDomains().ifPresent(domains -> {\n domains.keySet().forE...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_571
{ "fields": [ { "declarator": "IDENTITY = JdbcIdentity.from(SESSION)", "modifier": "private static final", "original_string": "private static final JdbcIdentity IDENTITY = JdbcIdentity.from(SESSION);", "type": "JdbcIdentity", "var_name": "IDENTITY" } ], "file": "presto-base-j...
{ "body": "@Test\n public void testRetryAndStopOnPrestoException()\n {\n MockConnectorFactory mock = new MockConnectorFactory(THROW_SQL_RECOVERABLE_EXCEPTION, THROW_PRESTO_EXCEPTION);\n ConnectionFactory factory = new RetryingConnectionFactory(mock);\n assertThatThrownBy(() -> factory.openC...
{ "fields": [ { "declarator": "RETRY_POLICY = new RetryPolicy<>()\n .withMaxDuration(java.time.Duration.of(30, SECONDS))\n .withMaxAttempts(5)\n .withBackoff(50, 5_000, MILLIS, 4)\n .handleIf(RetryingConnectionFactory::isSqlRecoverableException)\n .abor...
{ "body": "@Override\n public Connection openConnection(JdbcIdentity identity)\n throws SQLException\n {\n try {\n return Failsafe.with(RETRY_POLICY)\n .get(() -> delegate.openConnection(identity));\n }\n catch (FailsafeException ex) {\n i...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_121
{ "fields": [ { "declarator": "CODEC = jsonCodec(Storage.class)", "modifier": "private static final", "original_string": "private static final JsonCodec<Storage> CODEC = jsonCodec(Storage.class);", "type": "JsonCodec<Storage>", "var_name": "CODEC" } ], "file": "presto-hive/sr...
{ "body": "@Test\n public void testRoundTrip()\n {\n Storage storage = Storage.builder()\n .setStorageFormat(StorageFormat.create(\"abc\", \"in\", \"out\"))\n .setLocation(\"/test\")\n .build();\n\n assertEquals(CODEC.fromJson(CODEC.toJson(storage)), st...
{ "fields": [ { "declarator": "storageFormat", "modifier": "private final", "original_string": "private final StorageFormat storageFormat;", "type": "StorageFormat", "var_name": "storageFormat" }, { "declarator": "location", "modifier": "private final", "ori...
{ "body": "public static Builder builder()\n {\n return new Builder();\n }", "class_method_signature": "Storage.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "invocations": [], "modifiers": "public static", "parameters": "()"...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1112
{ "fields": [ { "declarator": "testFile", "modifier": "private", "original_string": "private File testFile;", "type": "File", "var_name": "testFile" } ], "file": "presto-main/src/test/java/io/prestosql/server/security/TestUserMapping.java", "identifier": "TestUserMapping", ...
{ "body": "@Test\n public void testNotAllowedRule()\n {\n UserMapping userMapping = new UserMapping(ImmutableList.of(new Rule(\"(.*?)@.*\", \"$1\", false, KEEP)));\n assertThrows(UserMappingException.class, () -> userMapping.mapUser(\"test@example.com\"));\n\n UserMapping emptyMapping = new...
{ "fields": [ { "declarator": "rules", "modifier": "private final", "original_string": "private final List<Rule> rules;", "type": "List<Rule>", "var_name": "rules" } ], "file": "presto-main/src/main/java/io/prestosql/server/security/UserMapping.java", "identifier": "UserMap...
{ "body": "public String mapUser(String principal)\n throws UserMappingException\n {\n for (Rule rule : rules) {\n Optional<String> user = rule.mapUser(principal);\n if (user.isPresent()) {\n return user.get();\n }\n }\n\n throw new Us...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_208
{ "fields": [], "file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/TestRaptorBucketFunction.java", "identifier": "TestRaptorBucketFunction", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInteger()\n {\n BucketFunction function = bucketFunction(50, INTEGER);\n assertEquals(getBucket(function, createIntsBlock(454345325)), 16);\n assertEquals(getBucket(function, createIntsBlock(365363)), 42);\n assertEquals(getBucket(function, createIn...
{ "fields": [ { "declarator": "functions", "modifier": "private final", "original_string": "private final HashFunction[] functions;", "type": "HashFunction[]", "var_name": "functions" }, { "declarator": "bucketCount", "modifier": "private final", "original_s...
{ "body": "@SuppressWarnings(\"NumericCastThatLosesPrecision\")\n @Override\n public int getBucket(Page page, int position)\n {\n long hash = 0;\n for (int i = 0; i < page.getChannelCount(); i++) {\n Block block = page.getBlock(i);\n long value = functions[i].hash(block, p...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_658
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java", "identifier": "TestTinyintOperators", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testCastToBigint()\n {\n assertFunction(\"cast(TINYINT'37' as bigint)\", BIGINT, 37L);\n assertFunction(\"cast(TINYINT'17' as bigint)\", BIGINT, 17L);\n }", "class_method_signature": "TestTinyintOperators.testCastToBigint()", "constructor": false, "full_sign...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java", "identifier": "TinyintOperators", "interfaces": "", "methods": [ { "class_method_signature": "TinyintOperators.TinyintOperators()", "constructor": true, "full_signature": "private TinyintOperato...
{ "body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.BIGINT)\n public static long castToBigint(@SqlType(StandardTypes.TINYINT) long value)\n {\n return value;\n }", "class_method_signature": "TinyintOperators.castToBigint(@SqlType(StandardTypes.TINYINT) long value)", "constructor": false, ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1057
{ "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 testStoredViewAnalysisScoping()\n {\n // the view must not be analyzed using the query context\n analyze(\"WITH t1 AS (SELECT 123 x) SELECT * FROM v1\");\n }", "class_method_signature": "TestAnalyzer.testStoredViewAnalysisScoping()", "constructor": false, "f...
{ "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_1113
{ "fields": [ { "declarator": "testFile", "modifier": "private", "original_string": "private File testFile;", "type": "File", "var_name": "testFile" } ], "file": "presto-main/src/test/java/io/prestosql/server/security/TestUserMapping.java", "identifier": "TestUserMapping", ...
{ "body": "@Test\n public void testMultipleRule()\n throws Exception\n {\n UserMapping userMapping = new UserMapping(ImmutableList.of(new Rule(\"test@example.com\", \"\", false, KEEP), new Rule(\"(.*?)@example.com\")));\n assertEquals(userMapping.mapUser(\"apple@example.com\"), \"apple\...
{ "fields": [ { "declarator": "rules", "modifier": "private final", "original_string": "private final List<Rule> rules;", "type": "List<Rule>", "var_name": "rules" } ], "file": "presto-main/src/main/java/io/prestosql/server/security/UserMapping.java", "identifier": "UserMap...
{ "body": "public String mapUser(String principal)\n throws UserMappingException\n {\n for (Rule rule : rules) {\n Optional<String> user = rule.mapUser(principal);\n if (user.isPresent()) {\n return user.get();\n }\n }\n\n throw new Us...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_209
{ "fields": [], "file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/TestRaptorBucketFunction.java", "identifier": "TestRaptorBucketFunction", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testVarchar()\n {\n BucketFunction function = bucketFunction(50, createUnboundedVarcharType());\n assertEquals(getBucket(function, createStringsBlock(\"lorem ipsum\")), 2);\n assertEquals(getBucket(function, createStringsBlock(\"lorem\")), 26);\n assert...
{ "fields": [ { "declarator": "functions", "modifier": "private final", "original_string": "private final HashFunction[] functions;", "type": "HashFunction[]", "var_name": "functions" }, { "declarator": "bucketCount", "modifier": "private final", "original_s...
{ "body": "@SuppressWarnings(\"NumericCastThatLosesPrecision\")\n @Override\n public int getBucket(Page page, int position)\n {\n long hash = 0;\n for (int i = 0; i < page.getChannelCount(); i++) {\n Block block = page.getBlock(i);\n long value = functions[i].hash(block, p...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_659
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java", "identifier": "TestTinyintOperators", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testCastToInteger()\n {\n assertFunction(\"cast(TINYINT'37' as integer)\", INTEGER, 37);\n assertFunction(\"cast(TINYINT'17' as integer)\", INTEGER, 17);\n }", "class_method_signature": "TestTinyintOperators.testCastToInteger()", "constructor": false, "full_...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java", "identifier": "TinyintOperators", "interfaces": "", "methods": [ { "class_method_signature": "TinyintOperators.TinyintOperators()", "constructor": true, "full_signature": "private TinyintOperato...
{ "body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.INTEGER)\n public static long castToInteger(@SqlType(StandardTypes.TINYINT) long value)\n {\n return value;\n }", "class_method_signature": "TinyintOperators.castToInteger(@SqlType(StandardTypes.TINYINT) long value)", "constructor": fals...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1056
{ "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 testShowCreateView()\n {\n analyze(\"SHOW CREATE VIEW v1\");\n analyze(\"SHOW CREATE VIEW v2\");\n\n assertFails(\"SHOW CREATE VIEW t1\")\n .hasErrorCode(NOT_SUPPORTED);\n assertFails(\"SHOW CREATE VIEW none\")\n .hasErrorC...
{ "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_435
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/type/TestChars.java", "identifier": "TestChars", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTruncateToLengthAndTrimSpaces()\n {\n assertEquals(utf8Slice(\"a\"), truncateToLengthAndTrimSpaces(utf8Slice(\"a c\"), 1));\n assertEquals(utf8Slice(\"a\"), truncateToLengthAndTrimSpaces(utf8Slice(\"a \"), 1));\n assertEquals(utf8Slice(\"a\"), truncateToL...
{ "fields": [], "file": "presto-spi/src/main/java/io/prestosql/spi/type/Chars.java", "identifier": "Chars", "interfaces": "", "methods": [ { "class_method_signature": "Chars.Chars()", "constructor": true, "full_signature": "private Chars()", "identifier": "Chars", "modifiers...
{ "body": "public static Slice truncateToLengthAndTrimSpaces(Slice slice, Type type)\n {\n requireNonNull(type, \"type is null\");\n if (!(type instanceof CharType)) {\n throw new IllegalArgumentException(\"type must be the instance of CharType\");\n }\n return truncateToLeng...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_966
{ "fields": [ { "declarator": "zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) -> new LongLiteral(\"0\"))", "modifier": "private", "original_string": "private ExpressionRewriteRuleSet zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) ...
{ "body": "@Test\n public void testProjectionExpressionRewrite()\n {\n tester().assertThat(zeroRewriter.projectExpressionRewrite())\n .on(p -> p.project(\n Assignments.of(p.symbol(\"y\"), PlanBuilder.expression(\"x IS NOT NULL\")),\n p.values(p...
{ "fields": [ { "declarator": "rewriter", "modifier": "private final", "original_string": "private final ExpressionRewriter rewriter;", "type": "ExpressionRewriter", "var_name": "rewriter" } ], "file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/Express...
{ "body": "public Rule<?> projectExpressionRewrite()\n {\n return new ProjectExpressionRewrite(rewriter);\n }", "class_method_signature": "ExpressionRewriteRuleSet.projectExpressionRewrite()", "constructor": false, "full_signature": "public Rule<?> projectExpressionRewrite()", "identifier": "proj...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_989
{ "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 testTableScan()\n {\n // Effective predicate is True if there is no effective predicate\n Map<Symbol, ColumnHandle> assignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C, D)));\n PlanNode node = TableScanNode.newInstance(\n ...
{ "fields": [ { "declarator": "SYMBOL_MATCHES_EXPRESSION =\n entry -> entry.getValue().equals(entry.getKey().toSymbolReference())", "modifier": "private static final", "original_string": "private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION...
{ "body": "public Expression extract(Session session, PlanNode node, TypeProvider types, TypeAnalyzer typeAnalyzer)\n {\n return node.accept(new Visitor(domainTranslator, metadata, session, types, typeAnalyzer, useTableProperties), null);\n }", "class_method_signature": "EffectivePredicateExtractor.ext...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_56
{ "fields": [ { "declarator": "tester = new JsonFieldDecoderTester(\"iso8601\")", "modifier": "private", "original_string": "private JsonFieldDecoderTester tester = new JsonFieldDecoderTester(\"iso8601\");", "type": "JsonFieldDecoderTester", "var_name": "tester" } ], "file": ...
{ "body": "@Test\n public void testDecode()\n {\n tester.assertDecodedAs(\"\\\"2018-02-19T09:20:11\\\"\", TIMESTAMP_MILLIS, 1_519_032_011_000_000L);\n tester.assertDecodedAs(\"\\\"2018-02-19T09:20:11Z\\\"\", TIMESTAMP_MILLIS, 1_519_032_011_000_000L);\n tester.assertDecodedAs(\"\\\"2018-02-1...
{ "fields": [ { "declarator": "SUPPORTED_TYPES = ImmutableSet.of(DATE, TIME, TIME_WITH_TIME_ZONE, TIMESTAMP_MILLIS, TIMESTAMP_WITH_TIME_ZONE)", "modifier": "private static final", "original_string": "private static final Set<Type> SUPPORTED_TYPES = ImmutableSet.of(DATE, TIME, TIME_WITH_TIME_ZONE...
{ "body": "@Override\n public FieldValueProvider decode(JsonNode value)\n {\n return new ISO8601JsonValueProvider(value, columnHandle);\n }", "class_method_signature": "ISO8601JsonFieldDecoder.decode(JsonNode value)", "constructor": false, "full_signature": "@Override public FieldValueProvider 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_823
{ "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 testLog()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n for (double base : DOUBLE_VALUES) {\n assertFunction(\"log(\" + base + \", \" + doubleValue + \")\", DOUBLE, Math.log(doubleValue) / Math.log(base));\n assertFunction(\"log...
{ "fields": [ { "declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()", "modifier": "public static final", "original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();", "type": "SqlScalarFunction", "var_name": "DECIMAL_MOD_FUNCTION" ...
{ "body": "@Description(\"Logarithm to given base\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double log(@SqlType(StandardTypes.DOUBLE) double base, @SqlType(StandardTypes.DOUBLE) double number)\n {\n return Math.log(number) / Math.log(base);\n }", "class_method_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_570
{ "fields": [ { "declarator": "IDENTITY = JdbcIdentity.from(SESSION)", "modifier": "private static final", "original_string": "private static final JdbcIdentity IDENTITY = JdbcIdentity.from(SESSION);", "type": "JdbcIdentity", "var_name": "IDENTITY" } ], "file": "presto-base-j...
{ "body": "@Test\n public void testSimplyReturnConnection()\n throws Exception\n {\n MockConnectorFactory mock = new MockConnectorFactory(RETURN);\n ConnectionFactory factory = new RetryingConnectionFactory(mock);\n assertNotNull(factory.openConnection(IDENTITY));\n assert...
{ "fields": [ { "declarator": "RETRY_POLICY = new RetryPolicy<>()\n .withMaxDuration(java.time.Duration.of(30, SECONDS))\n .withMaxAttempts(5)\n .withBackoff(50, 5_000, MILLIS, 4)\n .handleIf(RetryingConnectionFactory::isSqlRecoverableException)\n .abor...
{ "body": "@Override\n public Connection openConnection(JdbcIdentity identity)\n throws SQLException\n {\n try {\n return Failsafe.with(RETRY_POLICY)\n .get(() -> delegate.openConnection(identity));\n }\n catch (FailsafeException ex) {\n i...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_120
{ "fields": [], "file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/cache/TestReentrantBoundedExecutor.java", "identifier": "TestReentrantBoundedExecutor", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReentrantBoundedExecutor()\n throws ExecutionException, InterruptedException\n {\n AtomicInteger callCounter = new AtomicInteger();\n SettableFuture<Object> future = SettableFuture.create();\n ExecutorService executor = newCachedThreadPool();\n ...
{ "fields": [ { "declarator": "executorThreadMarkers = ThreadLocal.withInitial(() -> false)", "modifier": "private final", "original_string": "private final ThreadLocal<Boolean> executorThreadMarkers = ThreadLocal.withInitial(() -> false);", "type": "ThreadLocal<Boolean>", "var_name"...
{ "body": "ReentrantBoundedExecutor(Executor coreExecutor, int maxThreads)\n {\n this.boundedExecutor = new BoundedExecutor(requireNonNull(coreExecutor, \"coreExecutor is null\"), maxThreads);\n this.coreExecutor = coreExecutor;\n }", "class_method_signature": "ReentrantBoundedExecutor.Reentrant...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1144
{ "fields": [ { "declarator": "SQL_PARSER = new SqlParser()", "modifier": "private static final", "original_string": "private static final SqlParser SQL_PARSER = new SqlParser();", "type": "SqlParser", "var_name": "SQL_PARSER" }, { "declarator": "QUERY_PREPARER = new Qu...
{ "body": "@Test\n public void testParameterMismatchWithOffset()\n {\n Session session = testSessionBuilder()\n .addPreparedStatement(\"my_query\", \"SELECT ? FROM foo OFFSET ? ROWS\")\n .build();\n assertPrestoExceptionThrownBy(() -> QUERY_PREPARER.prepareQuery(sessi...
{ "fields": [ { "declarator": "sqlParser", "modifier": "private final", "original_string": "private final SqlParser sqlParser;", "type": "SqlParser", "var_name": "sqlParser" } ], "file": "presto-main/src/main/java/io/prestosql/execution/QueryPreparer.java", "identifier": "Q...
{ "body": "public PreparedQuery prepareQuery(Session session, String query)\n throws ParsingException, PrestoException\n {\n Statement wrappedStatement = sqlParser.createStatement(query, createParsingOptions(session));\n return prepareQuery(session, wrappedStatement);\n }", "class_met...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1001
{ "fields": [ { "declarator": "metadata = MetadataManager.createTestMetadataManager()", "modifier": "private final", "original_string": "private final Metadata metadata = MetadataManager.createTestMetadataManager();", "type": "Metadata", "var_name": "metadata" } ], "file": "p...
{ "body": "@Test\n public void testBigint()\n {\n List<RowExpression> values = new ArrayList<>();\n values.add(constant(Integer.MAX_VALUE + 1L, BIGINT));\n values.add(constant(Integer.MIN_VALUE - 1L, BIGINT));\n values.add(constant(3L, BIGINT));\n assertEquals(checkSwitchGener...
{ "fields": [ { "declarator": "valueExpression", "modifier": "private final", "original_string": "private final RowExpression valueExpression;", "type": "RowExpression", "var_name": "valueExpression" }, { "declarator": "testExpressions", "modifier": "private final...
{ "body": "@VisibleForTesting\n static SwitchGenerationCase checkSwitchGenerationCase(Type type, List<RowExpression> values)\n {\n if (values.size() > 32) {\n // 32 is chosen because\n // * SET_CONTAINS performs worst when smaller than but close to power of 2\n // * Bench...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_931
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java", "identifier": "TestLogicalPlanner", "interfaces": "", "superclass": "extends BasePlanTest" }
{ "body": "@Test\n public void testRedundantTopNNodeRemoval()\n {\n String query = \"SELECT count(*) FROM orders ORDER BY 1 LIMIT 10\";\n assertFalse(\n searchFrom(plan(query, OPTIMIZED).getRoot())\n .where(isInstanceOfAny(TopNNode.class, SortNode.class))\n ...
{ "fields": [ { "declarator": "idAllocator", "modifier": "private final", "original_string": "private final PlanNodeIdAllocator idAllocator;", "type": "PlanNodeIdAllocator", "var_name": "idAllocator" }, { "declarator": "session", "modifier": "private final", ...
{ "body": "public Plan plan(Analysis analysis)\n {\n return plan(analysis, OPTIMIZED_AND_VALIDATED);\n }", "class_method_signature": "LogicalPlanner.plan(Analysis analysis)", "constructor": false, "full_signature": "public Plan plan(Analysis analysis)", "identifier": "plan", "invocations": [ ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1282
{ "fields": [ { "declarator": "kinesisPlugin", "modifier": "private", "original_string": "private KinesisPlugin kinesisPlugin;", "type": "KinesisPlugin", "var_name": "kinesisPlugin" }, { "declarator": "connector", "modifier": "private", "original_string": "p...
{ "body": "@Test\n public void testRelatedObjects()\n {\n KinesisMetadata metadata = (KinesisMetadata) connector.getMetadata(new ConnectorTransactionHandle() {});\n assertNotNull(metadata);\n\n SchemaTableName tblName = new SchemaTableName(\"prod\", \"test_table\");\n List<String> sc...
{ "fields": [ { "declarator": "log = Logger.get(KinesisTableDescriptionSupplier.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(KinesisTableDescriptionSupplier.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public Map<SchemaTableName, KinesisStreamDescription> get()\n {\n if (s3TableConfigClient.isUsingS3()) {\n return s3TableConfigClient.getTablesFromS3();\n }\n\n return getTablesFromPath();\n }", "class_method_signature": "KinesisTableDescriptionSupplie...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_198
{ "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 void createAuthenticatedPrincipalRealAllOrgs()\n {\n // Skip this test if SALESFORCE_TEST_FORREAL is not set to TRUE.\n if (!forReal) {\n throw new SkipException(\"Skipping real tests.\");\n }\n\n String username = System.getenv(\"SALESFORCE_TEST_USERNAM...
{ "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_462
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/type/TestVarchars.java", "identifier": "TestVarchars", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTruncateToLength()\n {\n // Single byte code points\n assertEquals(truncateToLength(Slices.utf8Slice(\"abc\"), 0), Slices.utf8Slice(\"\"));\n assertEquals(truncateToLength(Slices.utf8Slice(\"abc\"), 1), Slices.utf8Slice(\"a\"));\n assertEquals(trunc...
{ "fields": [], "file": "presto-spi/src/main/java/io/prestosql/spi/type/Varchars.java", "identifier": "Varchars", "interfaces": "", "methods": [ { "class_method_signature": "Varchars.Varchars()", "constructor": true, "full_signature": "private Varchars()", "identifier": "Varchars"...
{ "body": "public static Slice truncateToLength(Slice slice, Type type)\n {\n requireNonNull(type, \"type is null\");\n if (!(type instanceof VarcharType)) {\n throw new IllegalArgumentException(\"type must be the instance of VarcharType\");\n }\n return truncateToLength(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_177
{ "fields": [ { "declarator": "BUCKET_COUNT = 2", "modifier": "private static final", "original_string": "private static final int BUCKET_COUNT = 2;", "type": "int", "var_name": "BUCKET_COUNT" }, { "declarator": "TIMESTAMP_PRECISION = 3", "modifier": "private stat...
{ "body": "@Test\n public void testGetAttemptId()\n {\n assertFalse(hasAttemptId(\"bucket_00000\"));\n assertTrue(hasAttemptId(\"bucket_00000_0\"));\n assertTrue(hasAttemptId(\"bucket_00000_10\"));\n assertTrue(hasAttemptId(\"bucket_00000_1000\"));\n assertFalse(hasAttemptId(\...
{ "fields": [ { "declarator": "BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\")", "modifier": "private static final", "original_string": "private static final Pattern BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN = Pattern.compile(\"bucket_(\\\\d+)(_\\\\d+)?$\"...
{ "body": "public static boolean hasAttemptId(String bucketFilename)\n {\n Matcher matcher = BUCKET_WITH_OPTIONAL_ATTEMPT_ID_PATTERN.matcher(bucketFilename);\n return matcher.matches() && matcher.group(2) != null;\n }", "class_method_signature": "BackgroundHiveSplitLoader.hasAttemptId(String buc...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_527
{ "fields": [], "file": "presto-redis/src/test/java/io/prestosql/plugin/redis/TestRedisPlugin.java", "identifier": "TestRedisPlugin", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStartup()\n {\n RedisPlugin plugin = new RedisPlugin();\n\n ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());\n assertInstanceOf(factory, RedisConnectorFactory.class);\n\n Connector c = factory.create(\n \"tes...
{ "fields": [ { "declarator": "tableDescriptionSupplier = Optional.empty()", "modifier": "private", "original_string": "private Optional<Supplier<Map<SchemaTableName, RedisTableDescription>>> tableDescriptionSupplier = Optional.empty();", "type": "Optional<Supplier<Map<SchemaTableName, Red...
{ "body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new RedisConnectorFactory(tableDescriptionSupplier));\n }", "class_method_signature": "RedisPlugin.getConnectorFactories()", "constructor": false, "full_signature": "@Override public It...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_874
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java", "identifier": "TestStringFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testCharTrim()\n {\n assertFunction(\"TRIM(CAST('' AS CHAR(20)))\", createCharType(20), padRight(\"\", 20));\n assertFunction(\"TRIM(CAST(' hello ' AS CHAR(9)))\", createCharType(9), padRight(\"hello\", 9));\n assertFunction(\"TRIM(CAST(' hello' AS CHAR(7))...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java", "identifier": "StringFunctions", "interfaces": "", "methods": [ { "class_method_signature": "StringFunctions.StringFunctions()", "constructor": true, "full_signature": "private StringF...
{ "body": "@Description(\"Removes whitespace from the beginning and end of a string\")\n @ScalarFunction(\"trim\")\n @LiteralParameters(\"x\")\n @SqlType(\"char(x)\")\n public static Slice charTrim(@SqlType(\"char(x)\") Slice slice)\n {\n return trim(slice);\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_1152
{ "fields": [ { "declarator": "STAGE_ID = new StageId(\"query\", 0)", "modifier": "private static final", "original_string": "private static final StageId STAGE_ID = new StageId(\"query\", 0);", "type": "StageId", "var_name": "STAGE_ID" }, { "declarator": "LOCATION = UR...
{ "body": "@Test\n public void testFinished()\n {\n StageStateMachine stateMachine = createStageStateMachine();\n\n assertTrue(stateMachine.transitionToFinished());\n assertFinalState(stateMachine, StageState.FINISHED);\n }", "class_method_signature": "TestStageStateMachine.testFinishe...
{ "fields": [ { "declarator": "log = Logger.get(StageStateMachine.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(StageStateMachine.class);", "type": "Logger", "var_name": "log" }, { "declarator": "stageId", ...
{ "body": "public boolean transitionToFinished()\n {\n return stageState.setIf(FINISHED, currentState -> !currentState.isDone());\n }", "class_method_signature": "StageStateMachine.transitionToFinished()", "constructor": false, "full_signature": "public boolean transitionToFinished()", "identifie...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_248
{ "fields": [], "file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/storage/TestStorageManagerConfig.java", "identifier": "TestStorageManagerConfig", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testValidations()\n {\n assertFailsValidation(new StorageManagerConfig().setDataDirectory(null), \"dataDirectory\", \"may not be null\", NotNull.class);\n }", "class_method_signature": "TestStorageManagerConfig.testValidations()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "dataDirectory", "modifier": "private", "original_string": "private File dataDirectory;", "type": "File", "var_name": "dataDirectory" }, { "declarator": "minAvailableSpace = DataSize.ofBytes(0)", "modifier": "private", "original...
{ "body": "@Config(\"storage.data-directory\")\n @ConfigDescription(\"Base directory to use for storing shard data\")\n public StorageManagerConfig setDataDirectory(File dataDirectory)\n {\n this.dataDirectory = dataDirectory;\n return this;\n }", "class_method_signature": "StorageManagerC...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_618
{ "fields": [ { "declarator": "TEST_EXECUTOR = newScheduledThreadPool(1, threadsNamed(\"test-executor-%s\"))", "modifier": "private static final", "original_string": "private static final ScheduledExecutorService TEST_EXECUTOR = newScheduledThreadPool(1, threadsNamed(\"test-executor-%s\"));", ...
{ "body": "@Test(dataProvider = \"testSetMemoryPoolOptions\")\n public void testSetMemoryPool(boolean useReservedPool)\n {\n QueryId secondQuery = new QueryId(\"second\");\n MemoryPool reservedPool = new MemoryPool(RESERVED_POOL, DataSize.ofBytes(10));\n long secondQueryMemory = reservedPoo...
{ "fields": [ { "declarator": "GUARANTEED_MEMORY = DataSize.of(1, MEGABYTE).toBytes()", "modifier": "private static final", "original_string": "private static final long GUARANTEED_MEMORY = DataSize.of(1, MEGABYTE).toBytes();", "type": "long", "var_name": "GUARANTEED_MEMORY" }, ...
{ "body": "public synchronized void setMemoryPool(MemoryPool newMemoryPool)\n {\n // This method first acquires the monitor of this instance.\n // After that in this method if we acquire the monitors of the\n // user/revocable memory contexts in the queryMemoryContext instance\n // (say...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1017
{ "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 testGrouping()\n {\n analyze(\"SELECT a, b, sum(c), grouping(a, b) FROM t1 GROUP BY GROUPING SETS ((a), (a, b))\");\n analyze(\"SELECT grouping(t1.a) FROM t1 GROUP BY a\");\n analyze(\"SELECT grouping(b) FROM t1 GROUP BY t1.b\");\n analyze(\"SELECT grou...
{ "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_474
{ "fields": [], "file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestAllOrNoneValueSet.java", "identifier": "TestAllOrNoneValueSet", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAll()\n {\n AllOrNoneValueSet valueSet = AllOrNoneValueSet.all(HYPER_LOG_LOG);\n assertEquals(valueSet.getType(), HYPER_LOG_LOG);\n assertFalse(valueSet.isNone());\n assertTrue(valueSet.isAll());\n assertFalse(valueSet.isSingleValue());\n ...
{ "fields": [ { "declarator": "type", "modifier": "private final", "original_string": "private final Type type;", "type": "Type", "var_name": "type" }, { "declarator": "all", "modifier": "private final", "original_string": "private final boolean all;", ...
{ "body": "static AllOrNoneValueSet all(Type type)\n {\n return new AllOrNoneValueSet(type, true);\n }", "class_method_signature": "AllOrNoneValueSet.all(Type type)", "constructor": false, "full_signature": "static AllOrNoneValueSet all(Type type)", "identifier": "all", "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_927
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/sql/planner/TestLogicalPlanner.java", "identifier": "TestLogicalPlanner", "interfaces": "", "superclass": "extends BasePlanTest" }
{ "body": "@Test\n public void testSameQualifiedSubqueryIsAppliedOnlyOnce()\n {\n // same ALL query used for left, right and complex condition\n assertEquals(\n countOfMatchingNodes(\n plan(\"SELECT * FROM orders o1 JOIN orders o2 ON o1.orderkey <= ALL(SELECT ...
{ "fields": [ { "declarator": "idAllocator", "modifier": "private final", "original_string": "private final PlanNodeIdAllocator idAllocator;", "type": "PlanNodeIdAllocator", "var_name": "idAllocator" }, { "declarator": "session", "modifier": "private final", ...
{ "body": "public Plan plan(Analysis analysis)\n {\n return plan(analysis, OPTIMIZED_AND_VALIDATED);\n }", "class_method_signature": "LogicalPlanner.plan(Analysis analysis)", "constructor": false, "full_signature": "public Plan plan(Analysis analysis)", "identifier": "plan", "invocations": [ ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_862
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java", "identifier": "TestStringFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testReplace()\n {\n assertFunction(\"REPLACE('aaa', 'a', 'aa')\", createVarcharType(11), \"aaaaaa\");\n assertFunction(\"REPLACE('abcdefabcdef', 'cd', 'XX')\", createVarcharType(38), \"abXXefabXXef\");\n assertFunction(\"REPLACE('abcdefabcdef', 'cd')\", create...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java", "identifier": "StringFunctions", "interfaces": "", "methods": [ { "class_method_signature": "StringFunctions.StringFunctions()", "constructor": true, "full_signature": "private StringF...
{ "body": "@Description(\"Greedily removes occurrences of a pattern in a string\")\n @ScalarFunction\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(\"varchar(x)\")\n public static Slice replace(@SqlType(\"varchar(x)\") Slice str, @SqlType(\"varchar(y)\") Slice search)\n {\n return replace(str, ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_17
{ "fields": [], "file": "presto-plugin-toolkit/src/test/java/io/prestosql/plugin/base/security/TestForwardingConnectorAccessControl.java", "identifier": "TestForwardingConnectorAccessControl", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testProperForwardingMethodsAreCalled()\n {\n assertProperForwardingMethodsAreCalled(ConnectorAccessControl.class, accessControl -> ForwardingConnectorAccessControl.of(() -> accessControl));\n }", "class_method_signature": "TestForwardingConnectorAccessControl.testPrope...
{ "fields": [], "file": "presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/security/ForwardingConnectorAccessControl.java", "identifier": "ForwardingConnectorAccessControl", "interfaces": "implements ConnectorAccessControl", "methods": [ { "class_method_signature": "ForwardingConnectorAcc...
{ "body": "public static ConnectorAccessControl of(Supplier<ConnectorAccessControl> connectorAccessControlSupplier)\n {\n requireNonNull(connectorAccessControlSupplier, \"connectorAccessControlSupplier is null\");\n return new ForwardingConnectorAccessControl()\n {\n @Override\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_531
{ "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 testSourceRegex()\n {\n ResourceGroupId resourceGroupId = new ResourceGroupId(new ResourceGroupId(\"global\"), \"foo\");\n StaticSelector selector = new StaticSelector(\n Optional.empty(),\n Optional.empty(),\n Optional.of...
{ "fields": [ { "declarator": "NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\")", "modifier": "private static final", "original_string": "private static final Pattern NAMED_GROUPS_PATTERN = Pattern.compile(\"\\\\(\\\\?<([a-zA-Z][a-zA-Z0-9]*)>\");", "type": "Pa...
{ "body": "@Override\n public Optional<SelectionContext<ResourceGroupIdTemplate>> match(SelectionCriteria criteria)\n {\n Map<String, String> variables = new HashMap<>();\n\n if (userRegex.isPresent()) {\n Matcher userMatcher = userRegex.get().matcher(criteria.getUser());\n i...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_161
{ "fields": [], "file": "presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveColumnHandle.java", "identifier": "TestHiveColumnHandle", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHiddenColumn()\n {\n HiveColumnHandle hiddenColumn = HiveColumnHandle.pathColumnHandle();\n testRoundTrip(hiddenColumn);\n }", "class_method_signature": "TestHiveColumnHandle.testHiddenColumn()", "constructor": false, "full_signature": "@Test public void...
{ "fields": [ { "declarator": "PATH_COLUMN_INDEX = -11", "modifier": "public static final", "original_string": "public static final int PATH_COLUMN_INDEX = -11;", "type": "int", "var_name": "PATH_COLUMN_INDEX" }, { "declarator": "PATH_COLUMN_NAME = \"$path\"", "mo...
{ "body": "public static HiveColumnHandle pathColumnHandle()\n {\n return createBaseColumn(PATH_COLUMN_NAME, PATH_COLUMN_INDEX, PATH_HIVE_TYPE, PATH_TYPE, SYNTHESIZED, Optional.empty());\n }", "class_method_signature": "HiveColumnHandle.pathColumnHandle()", "constructor": false, "full_signature": "...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1105
{ "fields": [ { "declarator": "session = TestingSession.testSessionBuilder().build()", "modifier": "private static final", "original_string": "private static final Session session = TestingSession.testSessionBuilder().build();", "type": "Session", "var_name": "session" } ], "...
{ "body": "@Test\n public void testStageCannotScheduleMoreTasks()\n {\n DynamicFilterService dynamicFilterService = new DynamicFilterService(newDirectExecutorService());\n DynamicFilterId filterId1 = new DynamicFilterId(\"df1\");\n Expression df1 = expression(\"DF_SYMBOL1\");\n Query...
{ "fields": [ { "declarator": "executor", "modifier": "private final", "original_string": "private final ExecutorService executor;", "type": "ExecutorService", "var_name": "executor" }, { "declarator": "dynamicFilterContexts = new ConcurrentHashMap<>()", "modifier...
{ "body": "public void stageCannotScheduleMoreTasks(StageId stageId, int numberOfTasks)\n {\n DynamicFilterContext context = dynamicFilterContexts.get(stageId.getQueryId());\n if (context == null) {\n // query has been removed\n return;\n }\n\n context.stageCannotS...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1040
{ "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 testInsert()\n {\n assertFails(\"INSERT INTO t6 (a) SELECT b from t6\")\n .hasErrorCode(TYPE_MISMATCH);\n analyze(\"INSERT INTO t1 SELECT * FROM t1\");\n analyze(\"INSERT INTO t3 SELECT * FROM t3\");\n analyze(\"INSERT INTO t3 SELECT a, b...
{ "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_970
{ "fields": [ { "declarator": "zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) -> new LongLiteral(\"0\"))", "modifier": "private", "original_string": "private ExpressionRewriteRuleSet zeroRewriter = new ExpressionRewriteRuleSet(\n (expression, context) ...
{ "body": "@Test\n public void testFilterExpressionRewrite()\n {\n tester().assertThat(zeroRewriter.filterExpressionRewrite())\n .on(p -> p.filter(new LongLiteral(\"1\"), p.values()))\n .matches(\n filter(\"0\", values()));\n }", "class_method_sig...
{ "fields": [ { "declarator": "rewriter", "modifier": "private final", "original_string": "private final ExpressionRewriter rewriter;", "type": "ExpressionRewriter", "var_name": "rewriter" } ], "file": "presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/Express...
{ "body": "public Rule<?> filterExpressionRewrite()\n {\n return new FilterExpressionRewrite(rewriter);\n }", "class_method_signature": "ExpressionRewriteRuleSet.filterExpressionRewrite()", "constructor": false, "full_signature": "public Rule<?> filterExpressionRewrite()", "identifier": "filterEx...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_589
{ "fields": [ { "declarator": "database", "modifier": "private", "original_string": "private TestingDatabase database;", "type": "TestingDatabase", "var_name": "database" }, { "declarator": "jdbcClient", "modifier": "private", "original_string": "private Jdb...
{ "body": "@Test\n public void testIdempotentClose()\n {\n RecordSet recordSet = createRecordSet(ImmutableList.of(\n columnHandles.get(\"value\"),\n columnHandles.get(\"value\"),\n columnHandles.get(\"text\")));\n\n RecordCursor cursor = recordSet.curso...
{ "fields": [ { "declarator": "jdbcClient", "modifier": "private final", "original_string": "private final JdbcClient jdbcClient;", "type": "JdbcClient", "var_name": "jdbcClient" }, { "declarator": "table", "modifier": "private final", "original_string": "pr...
{ "body": "@Override\n public RecordCursor cursor()\n {\n return new JdbcRecordCursor(jdbcClient, session, split, table, columnHandles);\n }", "class_method_signature": "JdbcRecordSet.cursor()", "constructor": false, "full_signature": "@Override public RecordCursor cursor()", "identifier": "cu...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_423
{ "fields": [], "file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java", "identifier": "TestGeoFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testSTGeometryType()\n {\n assertFunction(\"ST_GeometryType(ST_Point(1, 4))\", VARCHAR, \"ST_Point\");\n assertFunction(\"ST_GeometryType(ST_GeometryFromText('LINESTRING (1 1, 2 2)'))\", VARCHAR, \"ST_LineString\");\n assertFunction(\"ST_GeometryType(ST_Geomet...
{ "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 type of the geometry\")\n @ScalarFunction(\"ST_GeometryType\")\n @SqlType(VARCHAR)\n public static Slice stGeometryType(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n return GeometrySerde.getGeometryType(input).standardName();\n }", "class_method_signatur...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_136
{ "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 testCalculateDataSizeForPartitioningKey()\n {\n assertEquals(\n calculateDataSizeForPartitioningKey(\n PARTITION_COLUMN_2,\n BIGINT,\n ImmutableList.of(partition(\"p1=string1/p2=1234\")),\n ...
{ "fields": [ { "declarator": "log = Logger.get(MetastoreHiveStatisticsProvider.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(MetastoreHiveStatisticsProvider.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n static Estimate calculateDataSizeForPartitioningKey(\n HiveColumnHandle column,\n Type type,\n List<HivePartition> partitions,\n Map<String, PartitionStatistics> statistics,\n double averageRowsPerPartition)\n {\n if (...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_566
{ "fields": [ { "declarator": "SPLIT_SIZE = 100", "modifier": "private static final", "original_string": "private static final int SPLIT_SIZE = 100;", "type": "int", "var_name": "SPLIT_SIZE" }, { "declarator": "KEYSPACE = \"test_cassandra_token_split_manager_keyspace\""...
{ "body": "@Test\n public void testNonEmptyTable()\n throws Exception\n {\n String tableName = \"non_empty_table\";\n session.execute(format(\"CREATE TABLE %s.%s (key text PRIMARY KEY)\", KEYSPACE, tableName));\n for (int i = 0; i < PARTITION_COUNT; i++) {\n session.ex...
{ "fields": [ { "declarator": "session", "modifier": "private final", "original_string": "private final CassandraSession session;", "type": "CassandraSession", "var_name": "session" }, { "declarator": "splitSize", "modifier": "private final", "original_strin...
{ "body": "public List<TokenSplit> getSplits(String keyspace, String table, Optional<Long> sessionSplitsPerNode)\n {\n Set<TokenRange> tokenRanges = session.getTokenRanges();\n\n if (tokenRanges.isEmpty()) {\n throw new PrestoException(CASSANDRA_METADATA_ERROR, \"The cluster metadata is no...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_835
{ "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 testSign()\n {\n DecimalType expectedDecimalReturnType = createDecimalType(1, 0);\n\n //retains type for NULL values\n assertFunction(\"sign(CAST(NULL as TINYINT))\", TINYINT, null);\n assertFunction(\"sign(CAST(NULL as SMALLINT))\", SMALLINT, null);\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": "@ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long sign(@SqlType(StandardTypes.BIGINT) long num)\n {\n return (long) Math.signum(num);\n }", "class_method_signature": "MathFunctions.sign(@SqlType(StandardTypes.BIGINT) long num)", "constructor": false, "full_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_40
{ "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 testCanSetUserOperations()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"catalog_principal.json\");\n\n try {\n accessControl.checkCanSetUser(Optional.empty(), alice.getUser());\n throw new AssertionError(\"expected...
{ "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 checkCanSetUser(Optional<Principal> principal, String userName)\n {\n requireNonNull(principal, \"principal is null\");\n requireNonNull(userName, \"userName is null\");\n\n if (principalUserMatchRules.isEmpty()) {\n return;\n }\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_1191
{ "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 testInvalidConstructorArg()\n {\n try {\n createBroadcastBuffer(createInitialEmptyOutputBuffers(BROADCAST).withBuffer(FIRST, BROADCAST_PARTITION_ID).withNoMoreBufferIds(), DataSize.ofBytes(0));\n fail(\"Expected IllegalStateException\");\n }\n ...
{ "fields": [ { "declarator": "taskInstanceId", "modifier": "private final", "original_string": "private final String taskInstanceId;", "type": "String", "var_name": "taskInstanceId" }, { "declarator": "state", "modifier": "private final", "original_string":...
{ "body": "@Override\n public void fail()\n {\n // ignore fail if the buffer already in a terminal state.\n if (state.setIf(FAILED, oldState -> !oldState.isTerminal())) {\n memoryManager.setNoBlockOnFull();\n forceFreeMemory();\n // DO NOT destroy buffers or set no...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_771
{ "fields": [ { "declarator": "executor", "modifier": "private", "original_string": "private ExecutorService executor;", "type": "ExecutorService", "var_name": "executor" }, { "declarator": "scheduledExecutor", "modifier": "private", "original_string": "priv...
{ "body": "@Test(dataProvider = \"hashEnabledValues\")\n public void testSemiJoinOnVarcharType(boolean hashEnabled)\n {\n DriverContext driverContext = taskContext.addPipelineContext(0, true, true, false).addDriverContext();\n\n // build\n OperatorContext operatorContext = driverContext.add...
{ "fields": [ { "declarator": "pages", "modifier": "private final", "original_string": "private final WorkProcessor<Page> pages;", "type": "WorkProcessor<Page>", "var_name": "pages" } ], "file": "presto-main/src/main/java/io/prestosql/operator/HashSemiJoinOperator.java", "i...
{ "body": "public static OperatorFactory createOperatorFactory(\n int operatorId,\n PlanNodeId planNodeId,\n SetSupplier setSupplier,\n List<? extends Type> probeTypes,\n int probeJoinChannel,\n Optional<Integer> probeJoinHashChannel)\n {\n r...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_321
{ "fields": [ { "declarator": "NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\")", "modifier": "private static final", "original_string": "private static final ExampleTableHandle NUMBERS_TABLE_HANDLE = new ExampleTableHandle(\"example\", \"numbers\");", "type": "Examp...
{ "body": "@Test\n public void getTableMetadata()\n {\n // known table\n ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(SESSION, NUMBERS_TABLE_HANDLE);\n assertEquals(tableMetadata.getTable(), new SchemaTableName(\"example\", \"numbers\"));\n assertEquals(tableMetad...
{ "fields": [ { "declarator": "exampleClient", "modifier": "private final", "original_string": "private final ExampleClient exampleClient;", "type": "ExampleClient", "var_name": "exampleClient" } ], "file": "presto-example-http/src/main/java/io/prestosql/plugin/example/Exampl...
{ "body": "@Override\n public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table)\n {\n return getTableMetadata(((ExampleTableHandle) table).toSchemaTableName());\n }", "class_method_signature": "ExampleMetadata.getTableMetadata(ConnectorSession session, Con...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_634
{ "fields": [ { "declarator": "MAX_DATA_SIZE = DataSize.of(10, MEGABYTE)", "modifier": "private static final", "original_string": "private static final DataSize MAX_DATA_SIZE = DataSize.of(10, MEGABYTE);", "type": "DataSize", "var_name": "MAX_DATA_SIZE" }, { "declarator...
{ "body": "@Test\n public void testSpillSpaceTracker()\n {\n assertEquals(spillSpaceTracker.getCurrentBytes(), 0);\n assertEquals(spillSpaceTracker.getMaxBytes(), MAX_DATA_SIZE.toBytes());\n long reservedBytes = DataSize.of(5, MEGABYTE).toBytes();\n spillSpaceTracker.reserve(reserved...
{ "fields": [ { "declarator": "maxBytes", "modifier": "private final", "original_string": "private final long maxBytes;", "type": "long", "var_name": "maxBytes" }, { "declarator": "currentBytes", "modifier": "@GuardedBy(\"this\")\n private", "original_str...
{ "body": "public SpillSpaceTracker(DataSize maxSize)\n {\n requireNonNull(maxSize, \"maxSize is null\");\n maxBytes = maxSize.toBytes();\n currentBytes = 0;\n }", "class_method_signature": "SpillSpaceTracker.SpillSpaceTracker(DataSize maxSize)", "constructor": true, "full_signature":...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_264
{ "fields": [ { "declarator": "DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC)", "modifier": "private static final", "original_string": "private static final DateTime DATE_TIME = new DateTime(1970, 1, 2, 0, 0, 0, UTC);", "type": "DateTime", "var_name": "DATE_TIME" } ], "fi...
{ "body": "@Test\n public void testDateBlock()\n {\n BlockBuilder blockBuilder = DATE.createBlockBuilder(null, 2);\n DATE.writeLong(blockBuilder, 13);\n DATE.writeLong(blockBuilder, 42);\n Block block = blockBuilder.build();\n\n assertEquals(TemporalFunction.getDay(DATE, block...
{ "fields": [], "file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/organization/TemporalFunction.java", "identifier": "TemporalFunction", "interfaces": "", "methods": [ { "class_method_signature": "TemporalFunction.TemporalFunction()", "constructor": true, ...
{ "body": "public static int getDay(Type type, Block block, int position)\n {\n if (type.equals(DATE)) {\n return toIntExact(DATE.getLong(block, position));\n }\n\n if (type.equals(TIMESTAMP_MILLIS)) {\n long days = floorDiv(TIMESTAMP_MILLIS.getLong(block, position), MICR...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1257
{ "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 testInstantMicros()\n {\n assertThat(getDomain(TIMESTAMP_TZ_MICROS, 0, null))\n .isEqualTo(none(TIMESTAMP_TZ_MICROS));\n assertThat(getDomain(TIMESTAMP_TZ_MICROS, 10, null))\n .isEqualTo(all(TIMESTAMP_TZ_MICROS));\n\n assertThat(g...
{ "fields": [ { "declarator": "columnDomains", "modifier": "private final", "original_string": "private final List<ColumnDomain> columnDomains;", "type": "List<ColumnDomain>", "var_name": "columnDomains" }, { "declarator": "orcBloomFiltersEnabled", "modifier": "pr...
{ "body": "@VisibleForTesting\n public static Domain getDomain(Type type, long rowCount, ColumnStatistics columnStatistics)\n {\n if (rowCount == 0) {\n return Domain.none(type);\n }\n\n if (columnStatistics == null) {\n return Domain.all(type);\n }\n\n i...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_458
{ "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 testShiftLeftMultiPrecision()\n {\n assertEquals(shiftLeftMultiPrecision(\n new int[] {0b10100001010001011010000101000101, 0b01010110100101101011010101010101, 0b01010010111110001111100010101010,\n 0b11111111000000011010101010101011, 0b0...
{ "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 int[] shiftLeftMultiPrecision(int[] number, int length, int shifts)\n {\n if (shifts == 0) {\n return number;\n }\n // wordShifts = shifts / 32\n int wordShifts = shifts >>> 5;\n // we don't wan't to loose any leading bits\n for (int i = 0; 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_376
{ "fields": [], "file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java", "identifier": "TestGeoFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testSpatialPartitions()\n {\n String kdbTreeJson = makeKdbTreeJson();\n\n assertSpatialPartitions(kdbTreeJson, \"POINT EMPTY\", null);\n // points inside partitions\n assertSpatialPartitions(kdbTreeJson, \"POINT (0 0)\", ImmutableList.of(0));\n a...
{ "fields": [ { "declarator": "OR_JOINER = Joiner.on(\" or \")", "modifier": "private static final", "original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");", "type": "Joiner", "var_name": "OR_JOINER" }, { "declarator": "EMPTY_POLYGON = serializ...
{ "body": "@ScalarFunction\n @SqlNullable\n @Description(\"Returns an array of spatial partition IDs for a given geometry\")\n @SqlType(\"array(integer)\")\n public static Block spatialPartitions(@SqlType(KdbTreeType.NAME) Object kdbTree, @SqlType(GEOMETRY_TYPE_NAME) Slice geometry)\n {\n Envelo...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_726
{ "fields": [ { "declarator": "blockTypeOperators = new BlockTypeOperators(new TypeOperators())", "modifier": "private", "original_string": "private BlockTypeOperators blockTypeOperators = new BlockTypeOperators(new TypeOperators());", "type": "BlockTypeOperators", "var_name": "block...
{ "body": "@Test\n public void testBinaryMergeIteratorOverEmptyPageAndNonEmptyPage()\n {\n Page emptyPage = new Page(0, BIGINT.createFixedSizeBlockBuilder(0).build());\n Page page = rowPagesBuilder(BIGINT).row(42).build().get(0);\n\n WorkProcessor<Page> mergedPage = new MergeHashSort(newSim...
{ "fields": [ { "declarator": "memoryContext", "modifier": "private final", "original_string": "private final AggregatedMemoryContext memoryContext;", "type": "AggregatedMemoryContext", "var_name": "memoryContext" }, { "declarator": "blockTypeOperators", "modifier...
{ "body": "public WorkProcessor<Page> merge(List<Type> keyTypes, List<Type> allTypes, List<WorkProcessor<Page>> channels, DriverYieldSignal driverYieldSignal)\n {\n InterpretedHashGenerator hashGenerator = createHashGenerator(keyTypes);\n return mergeSortedPages(\n channels,\n ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1129
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/server/TestRangeJsonSerde.java", "identifier": "TestRangeJsonSerde", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRangeJsonSerde()\n throws JsonProcessingException\n {\n TestingTypeManager typeManager = new TestingTypeManager();\n TestingBlockEncodingSerde blockEncodingSerde = new TestingBlockEncodingSerde();\n\n ObjectMapper mapper = new ObjectMapperProvid...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/server/RangeJsonSerde.java", "identifier": "RangeJsonSerde", "interfaces": "", "methods": [ { "class_method_signature": "RangeJsonSerde.RangeJsonSerde()", "constructor": true, "full_signature": "private RangeJsonSerde()", ...
{ "body": "private RangeJsonSerde() {}", "class_method_signature": "RangeJsonSerde.RangeJsonSerde()", "constructor": true, "full_signature": "private RangeJsonSerde()", "identifier": "RangeJsonSerde", "invocations": [], "modifiers": "private", "parameters": "()", "return": "", "signature": " RangeJ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1083
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/cost/TestStatisticRange.java", "identifier": "TestStatisticRange", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIntersect()\n {\n StatisticRange zeroToTen = range(0, 10, 10);\n StatisticRange fiveToFifteen = range(5, 15, 60);\n assertEquals(zeroToTen.intersect(fiveToFifteen), range(5, 10, 10));\n }", "class_method_signature": "TestStatisticRange.testIntersect()...
{ "fields": [ { "declarator": "INFINITE_TO_FINITE_RANGE_INTERSECT_OVERLAP_HEURISTIC_FACTOR = 0.25", "modifier": "private static final", "original_string": "private static final double INFINITE_TO_FINITE_RANGE_INTERSECT_OVERLAP_HEURISTIC_FACTOR = 0.25;", "type": "double", "var_name": ...
{ "body": "public StatisticRange intersect(StatisticRange other)\n {\n double newLow = max(low, other.low);\n double newHigh = min(high, other.high);\n if (newLow <= newHigh) {\n return new StatisticRange(newLow, newHigh, overlappingDistinctValues(other));\n }\n return...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_233
{ "fields": [ { "declarator": "dbi", "modifier": "private", "original_string": "private IDBI dbi;", "type": "IDBI", "var_name": "dbi" }, { "declarator": "dummyHandle", "modifier": "private", "original_string": "private Handle dummyHandle;", "type": "Ha...
{ "body": "@Test\n public void testCleanBackupShards()\n throws Exception\n {\n assertEquals(cleaner.getBackupShardsCleaned().getTotalCount(), 0);\n\n TestingDao dao = dbi.onDemand(TestingDao.class);\n\n UUID shard1 = randomUUID();\n UUID shard2 = randomUUID();\n UU...
{ "fields": [ { "declarator": "log = Logger.get(ShardCleaner.class)", "modifier": "private static final", "original_string": "private static final Logger log = Logger.get(ShardCleaner.class);", "type": "Logger", "var_name": "log" }, { "declarator": "dao", "modifie...
{ "body": "@VisibleForTesting\n void cleanBackupShards()\n {\n Set<UUID> processing = newConcurrentHashSet();\n BlockingQueue<UUID> completed = new LinkedBlockingQueue<>();\n boolean fill = true;\n\n while (!Thread.currentThread().isInterrupted()) {\n // get a new batch if...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_399
{ "fields": [], "file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java", "identifier": "TestGeoFunctions", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testSTEnvelopeAsPts()\n {\n assertEnvelopeAsPts(\"MULTIPOINT (1 2, 2 4, 3 6, 4 8)\", new Point(1, 2), new Point(4, 8));\n assertFunction(\"ST_EnvelopeAsPts(ST_GeometryFromText('LINESTRING EMPTY'))\", new ArrayType(GEOMETRY), null);\n assertEnvelopeAsPts(\"LINE...
{ "fields": [ { "declarator": "OR_JOINER = Joiner.on(\" or \")", "modifier": "private static final", "original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");", "type": "Joiner", "var_name": "OR_JOINER" }, { "declarator": "EMPTY_POLYGON = serializ...
{ "body": "@SqlNullable\n @Description(\"Returns the lower left and upper right corners of bounding rectangular polygon of a Geometry\")\n @ScalarFunction(\"ST_EnvelopeAsPts\")\n @SqlType(\"array(\" + GEOMETRY_TYPE_NAME + \")\")\n public static Block stEnvelopeAsPts(@SqlType(GEOMETRY_TYPE_NAME) Slice inpu...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_663
{ "fields": [], "file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java", "identifier": "TestTinyintOperators", "interfaces": "", "superclass": "extends AbstractTestFunctions" }
{ "body": "@Test\n public void testCastToBoolean()\n {\n assertFunction(\"cast(TINYINT'37' as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(TINYINT'17' as boolean)\", BOOLEAN, true);\n assertFunction(\"cast(TINYINT'0' as boolean)\", BOOLEAN, false);\n }", "class_method_signature"...
{ "fields": [], "file": "presto-main/src/main/java/io/prestosql/type/TinyintOperators.java", "identifier": "TinyintOperators", "interfaces": "", "methods": [ { "class_method_signature": "TinyintOperators.TinyintOperators()", "constructor": true, "full_signature": "private TinyintOperato...
{ "body": "@ScalarOperator(CAST)\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean castToBoolean(@SqlType(StandardTypes.TINYINT) long value)\n {\n return value != 0;\n }", "class_method_signature": "TinyintOperators.castToBoolean(@SqlType(StandardTypes.TINYINT) long value)", "constructo...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_1200
{ "fields": [ { "declarator": "TASK_INSTANCE_ID = \"task-instance-id\"", "modifier": "private static final", "original_string": "private static final String TASK_INSTANCE_ID = \"task-instance-id\";", "type": "String", "var_name": "TASK_INSTANCE_ID" }, { "declarator": "T...
{ "body": "@Test\n public void testInvalidConstructorArg()\n {\n try {\n createArbitraryBuffer(createInitialEmptyOutputBuffers(ARBITRARY).withBuffer(FIRST, BROADCAST_PARTITION_ID).withNoMoreBufferIds(), DataSize.ofBytes(0));\n fail(\"Expected IllegalStateException\");\n }\n ...
{ "fields": [ { "declarator": "memoryManager", "modifier": "private final", "original_string": "private final OutputBufferMemoryManager memoryManager;", "type": "OutputBufferMemoryManager", "var_name": "memoryManager" }, { "declarator": "outputBuffers = createInitialEmp...
{ "body": "@Override\n public void fail()\n {\n // ignore fail if the buffer already in a terminal state.\n if (state.setIf(FAILED, oldState -> !oldState.isTerminal())) {\n memoryManager.setNoBlockOnFull();\n forceFreeMemory();\n // DO NOT destroy buffers or set no...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...
166515022_819
{ "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 testFloor()\n {\n assertFunction(\"floor(TINYINT'123')\", TINYINT, (byte) 123);\n assertFunction(\"floor(TINYINT'-123')\", TINYINT, (byte) -123);\n assertFunction(\"floor(CAST(NULL AS TINYINT))\", TINYINT, null);\n assertFunction(\"floor(SMALLINT'123')\...
{ "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(\"Round down to nearest integer\")\n @ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long floor(@SqlType(StandardTypes.BIGINT) long num)\n {\n return num;\n }", "class_method_signature": "MathFunctions.floor(@SqlType(StandardTypes.BIGINT) long num)", ...
{ "created": "1/19/2019 6:38:14 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 166515022, "size": null, "stargazer_count": null, "stars": 849, "updates": "2020-01-27T22:04:31+00:00", "url": "https://github.com/prestosql/prest...