id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
166515022_83 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/alluxio/TestProtoUtils.java",
"identifier": "TestProtoUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDatabaseNameLocation()\n {\n Database db = ProtoUtils.fromProto(TestingAlluxioMetastoreObjects.getTestingDatabase().build());\n assertEquals(TestingAlluxioMetastoreObjects.DATABASE_NAME, db.getDatabaseName());\n assertEquals(\"alluxio:///\", db.getLocation... | {
"fields": [],
"file": "presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/alluxio/ProtoUtils.java",
"identifier": "ProtoUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProtoUtils.ProtoUtils()",
"constructor": true,
"full_signature": "private ProtoUtils()"... | {
"body": "public static Database fromProto(alluxio.grpc.table.Database db)\n {\n return Database.builder()\n .setDatabaseName(db.getDbName())\n .setLocation(db.hasLocation() ? Optional.of(db.getLocation()) : Optional.empty())\n .setOwnerName(db.getOwnerName())\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_730 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/window/TestLeadFunction.java",
"identifier": "TestLeadFunction",
"interfaces": "",
"superclass": "extends AbstractTestWindowFunction"
} | {
"body": "@Test\n public void testLeadFunction()\n {\n assertWindowQuery(\"lead(orderdate) OVER (PARTITION BY orderstatus ORDER BY orderkey)\",\n resultBuilder(TEST_SESSION, INTEGER, VARCHAR, VARCHAR)\n .row(3, \"F\", \"1994-07-30\")\n .row(5,... | {
"fields": [
{
"declarator": "valueChannel",
"modifier": "private final",
"original_string": "private final int valueChannel;",
"type": "int",
"var_name": "valueChannel"
},
{
"declarator": "offsetChannel",
"modifier": "private final",
"original_string": "pr... | {
"body": "public LeadFunction(List<Integer> argumentChannels, boolean ignoreNulls)\n {\n this.valueChannel = argumentChannels.get(0);\n this.offsetChannel = (argumentChannels.size() > 1) ? argumentChannels.get(1) : -1;\n this.defaultChannel = (argumentChannels.size() > 2) ? argumentChannels.g... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_360 | {
"fields": [],
"file": "presto-parser/src/test/java/io/prestosql/sql/parser/TestStatementSplitter.java",
"identifier": "TestStatementSplitter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSqueezeStatementWithIncompleteQuotedString()\n {\n String sql = \"select * from\\n foo\\n where x = 'oops\";\n assertEquals(squeezeStatement(sql), \"select * from foo where x = 'oops\");\n }",
"class_method_signature": "TestStatementSplitter.testSqueezeS... | {
"fields": [
{
"declarator": "completeStatements",
"modifier": "private final",
"original_string": "private final List<Statement> completeStatements;",
"type": "List<Statement>",
"var_name": "completeStatements"
},
{
"declarator": "partialStatement",
"modifier": ... | {
"body": "public static String squeezeStatement(String sql)\n {\n TokenSource tokens = getLexer(sql, ImmutableSet.of());\n StringBuilder sb = new StringBuilder();\n while (true) {\n Token token = tokens.nextToken();\n if (token.getType() == Token.EOF) {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_675 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestRowParametricType.java",
"identifier": "TestRowParametricType",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTypeSignatureRoundTrip()\n {\n TypeManager typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators());\n TypeSignature typeSignature = new TypeSignature(\n ROW,\n TypeSignatureParameter.namedTypeParameter... | {
"fields": [
{
"declarator": "ROW = new RowParametricType()",
"modifier": "public static final",
"original_string": "public static final RowParametricType ROW = new RowParametricType();",
"type": "RowParametricType",
"var_name": "ROW"
}
],
"file": "presto-main/src/main/java/... | {
"body": "@Override\n public Type createType(TypeManager typeManager, List<TypeParameter> parameters)\n {\n checkArgument(!parameters.isEmpty(), \"Row type must have at least one parameter\");\n checkArgument(\n parameters.stream().allMatch(parameter -> parameter.getKind() == Param... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_225 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/metadata/TestJdbcDatabaseConfig.java",
"identifier": "TestJdbcDatabaseConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = ImmutableMap.<String, String>builder()\n .put(\"metadata.db.url\", \"jdbc:test://example.net/test\")\n .build();\n\n JdbcDatabaseConfig expected = new JdbcDatabaseConf... | {
"fields": [
{
"declarator": "url",
"modifier": "private",
"original_string": "private String url;",
"type": "String",
"var_name": "url"
}
],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java",
"identifier": "Jdb... | {
"body": "@Config(\"metadata.db.url\")\n public JdbcDatabaseConfig setUrl(String url)\n {\n this.url = url;\n return this;\n }",
"class_method_signature": "JdbcDatabaseConfig.setUrl(String url)",
"constructor": false,
"full_signature": "@Config(\"metadata.db.url\") public JdbcDatabaseCon... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1095 | {
"fields": [
{
"declarator": "BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(BOOLEAN))",
"modifier": "private static final",
"original_string": "private static final Function<String, Column> BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(B... | {
"body": "@Test\n public void shouldNotThrowWhenDataAndColumnsAreMissing()\n {\n QueryResultRows.empty(getSession());\n }",
"class_method_signature": "TestQueryResultRows.shouldNotThrowWhenDataAndColumnsAreMissing()",
"constructor": false,
"full_signature": "@Test public void shouldNotThrowWhen... | {
"fields": [
{
"declarator": "session",
"modifier": "private final",
"original_string": "private final ConnectorSession session;",
"type": "ConnectorSession",
"var_name": "session"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string"... | {
"body": "public static QueryResultRows empty(Session session)\n {\n return new QueryResultRows(session, Optional.empty(), ImmutableList.of(), null);\n }",
"class_method_signature": "QueryResultRows.empty(Session session)",
"constructor": false,
"full_signature": "public static QueryResultRows emp... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1216 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/execution/scheduler/TestPhasedExecutionSchedule.java",
"identifier": "TestPhasedExecutionSchedule",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBroadcastJoin()\n {\n PlanFragment buildFragment = createTableScanPlanFragment(\"build\");\n PlanFragment joinFragment = createBroadcastJoinPlanFragment(\"join\", buildFragment);\n\n List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(... | {
"fields": [
{
"declarator": "schedulePhases",
"modifier": "private final",
"original_string": "private final List<Set<SqlStageExecution>> schedulePhases;",
"type": "List<Set<SqlStageExecution>>",
"var_name": "schedulePhases"
},
{
"declarator": "activeSources = new Has... | {
"body": "@VisibleForTesting\n static List<Set<PlanFragmentId>> extractPhases(Collection<PlanFragment> fragments)\n {\n // Build a graph where the plan fragments are vertexes and the edges represent\n // a before -> after relationship. For example, a join hash build has an edge\n // to th... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_95 | {
"fields": [
{
"declarator": "TEST_SCHEMA = ImmutableList.of(\n new FieldSchema(\"col1\", \"bigint\", \"comment1\"),\n new FieldSchema(\"col2\", \"binary\", null),\n new FieldSchema(\"col3\", \"string\", null))",
"modifier": "private static final",
"original_str... | {
"body": "@Test\n public void testHiveSchemaTable()\n {\n Properties expected = MetaStoreUtils.getTableMetadata(TEST_TABLE_WITH_UNSUPPORTED_FIELDS);\n expected.remove(COLUMN_NAME_DELIMITER);\n Properties actual = MetastoreUtil.getHiveSchema(ThriftMetastoreUtil.fromMetastoreApiTable(TEST_TA... | {
"fields": [
{
"declarator": "HIVE_PARTITION_VALUE_WILDCARD = \"\"",
"modifier": "private static final",
"original_string": "private static final String HIVE_PARTITION_VALUE_WILDCARD = \"\";",
"type": "String",
"var_name": "HIVE_PARTITION_VALUE_WILDCARD"
}
],
"file": "presto... | {
"body": "public static Properties getHiveSchema(Table table)\n {\n // Mimics function in Hive: MetaStoreUtils.getTableMetadata(Table)\n return getHiveSchema(\n table.getStorage(),\n table.getDataColumns(),\n table.getDataColumns(),\n table... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_419 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTLineString()\n {\n // General case, 2+ points\n assertFunction(\"ST_LineString(array[ST_Point(1,2), ST_Point(3,4)])\", GEOMETRY, \"LINESTRING (1 2, 3 4)\");\n assertFunction(\"ST_LineString(array[ST_Point(1,2), ST_Point(3,4), ST_Point(5, 6)])\", GEOMETRY... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns a LineString from an array of points\")\n @ScalarFunction(\"ST_LineString\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stLineString(@SqlType(\"array(\" + GEOMETRY_TYPE_NAME + \")\") Block input)\n {\n MultiPath multipath = new Polyline();\n OGCPoi... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_337 | {
"fields": [
{
"declarator": "TEST_CATALOG = \"test_catalog\"",
"modifier": "private static final",
"original_string": "private static final String TEST_CATALOG = \"test_catalog\";",
"type": "String",
"var_name": "TEST_CATALOG"
},
{
"declarator": "COUNTING_CATALOG = \"... | {
"body": "@Test\n public void testGetTypeInfo()\n throws Exception\n {\n DatabaseMetaData metaData = connection.getMetaData();\n ResultSet typeInfo = metaData.getTypeInfo();\n while (typeInfo.next()) {\n int jdbcType = typeInfo.getInt(\"DATA_TYPE\");\n swit... | {
"fields": [
{
"declarator": "SEARCH_STRING_ESCAPE = \"\\\\\"",
"modifier": "private static final",
"original_string": "private static final String SEARCH_STRING_ESCAPE = \"\\\\\";",
"type": "String",
"var_name": "SEARCH_STRING_ESCAPE"
},
{
"declarator": "connection",
... | {
"body": "@Override\n public ResultSet getTypeInfo()\n throws SQLException\n {\n return select(\"\" +\n \"SELECT TYPE_NAME, DATA_TYPE, PRECISION, LITERAL_PREFIX, LITERAL_SUFFIX,\\n\" +\n \"CREATE_PARAMS, NULLABLE, CASE_SENSITIVE, SEARCHABLE, UNSIGNED_ATTRIBUTE,\\... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_767 | {
"fields": [
{
"declarator": "executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass().getSimpleName() + \"-%s\"))",
"modifier": "private final",
"original_string": "private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed(getClass()... | {
"body": "@Test\n public void testSelectNoneFilterLazyLoad()\n {\n PageProcessor pageProcessor = new PageProcessor(Optional.of(new SelectNoneFilter()), ImmutableList.of(new InputPageProjection(1, BIGINT)));\n\n // if channel 1 is loaded, test will fail\n Page inputPage = new Page(createLon... | {
"fields": [
{
"declarator": "MAX_BATCH_SIZE = 8 * 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_BATCH_SIZE = 8 * 1024;",
"type": "int",
"var_name": "MAX_BATCH_SIZE"
},
{
"declarator": "MAX_PAGE_SIZE_IN_BYTES = 4 * 1024 * 102... | {
"body": "public Iterator<Optional<Page>> process(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page)\n {\n return process(session, yieldSignal, memoryContext, page, false);\n }",
"class_method_signature": "PageProcessor.process(ConnectorSession sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1187 | {
"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 testAddAfterDestroy()\n {\n ClientBuffer buffer = new ClientBuffer(TASK_INSTANCE_ID, BUFFER_ID);\n buffer.destroy();\n addPage(buffer, createPage(0));\n addPage(buffer, createPage(0));\n assertBufferDestroyed(buffer, 0);\n }",
"class_method_... | {
"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_1168 | {
"fields": [
{
"declarator": "CATALOG_NAME = \"catalog\"",
"modifier": "private static final",
"original_string": "private static final String CATALOG_NAME = \"catalog\";",
"type": "String",
"var_name": "CATALOG_NAME"
},
{
"declarator": "PARENT_TABLE = new ConnectorTab... | {
"body": "@Test\n public void testCreateLikeDenyPermission()\n {\n CreateTable statement = getCreatleLikeStatement(false);\n\n TestingAccessControlManager accessControl = new TestingAccessControlManager(transactionManager, new EventListenerManager(new EventListenerConfig()));\n accessContr... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CreateTableTask.java",
"identifier": "CreateTableTask",
"interfaces": "implements DataDefinitionTask<CreateTable>",
"methods": [
{
"class_method_signature": "CreateTableTask.getName()",
"constructor": false,
"full_... | {
"body": "@VisibleForTesting\n ListenableFuture<?> internalExecute(CreateTable statement, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters)\n {\n checkArgument(!statement.getElements().isEmpty(), \"no columns for table\");\n\n Map<NodeRef<Parameter>, Ex... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_788 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testToBase64()\n {\n assertFunction(\"to_base64(CAST('' AS VARBINARY))\", VARCHAR, encodeBase64(\"\"));\n assertFunction(\"to_base64(CAST('a' AS VARBINARY))\", VARCHAR, encodeBase64(\"a\"));\n assertFunction(\"to_base64(CAST('abc' AS VARBINARY))\", VARCHAR, en... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Encode binary data as base64\")\n @ScalarFunction\n @SqlType(StandardTypes.VARCHAR)\n public static Slice toBase64(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n if (slice.hasByteArray()) {\n return Slices.wrappedBuffer(Base64.getEncoder().encode(slice.toB... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_272 | {
"fields": [
{
"declarator": "MAX_SHARD_ROWS = 1000",
"modifier": "private static final",
"original_string": "private static final int MAX_SHARD_ROWS = 1000;",
"type": "int",
"var_name": "MAX_SHARD_ROWS"
},
{
"declarator": "PAGE_SORTER = new PagesIndexPageSorter(new Pa... | {
"body": "@Test\n public void testShardCompactorSorted()\n throws Exception\n {\n List<Type> columnTypes = ImmutableList.of(BIGINT, createVarcharType(20), DATE, TIMESTAMP_MILLIS, DOUBLE);\n List<Long> columnIds = ImmutableList.of(3L, 7L, 2L, 1L, 5L);\n List<Long> sortColumnIds =... | {
"fields": [
{
"declarator": "storageManager",
"modifier": "private final",
"original_string": "private final StorageManager storageManager;",
"type": "StorageManager",
"var_name": "storageManager"
},
{
"declarator": "inputShards = new CounterStat()",
"modifier":... | {
"body": "public List<ShardInfo> compactSorted(long transactionId, OptionalInt bucketNumber, Set<UUID> uuids, List<ColumnInfo> columns, List<Long> sortColumnIds, List<SortOrder> sortOrders)\n throws IOException\n {\n checkArgument(sortColumnIds.size() == sortOrders.size(), \"sortColumnIds and so... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_622 | {
"fields": [
{
"declarator": "TYPE_OPERATORS_CACHE = new TypeOperators()",
"modifier": "private static final",
"original_string": "private static final TypeOperators TYPE_OPERATORS_CACHE = new TypeOperators();",
"type": "TypeOperators",
"var_name": "TYPE_OPERATORS_CACHE"
}
],
... | {
"body": "@Test\n public void testMultipleStreams()\n {\n List<Type> types = ImmutableList.of(INTEGER, INTEGER, INTEGER);\n MaterializedResult actual = mergeSortedPages(\n types,\n ImmutableList.of(0, 1),\n ImmutableList.of(ASC_NULLS_FIRST, DESC_NULLS_... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/util/MergeSortedPages.java",
"identifier": "MergeSortedPages",
"interfaces": "",
"methods": [
{
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPag... | {
"body": "private MergeSortedPages() {}",
"class_method_signature": "MergeSortedPages.MergeSortedPages()",
"constructor": true,
"full_signature": "private MergeSortedPages()",
"identifier": "MergeSortedPages",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1241 | {
"fields": [],
"file": "presto-orc/src/test/java/io/prestosql/orc/TestOrcDataSourceUtils.java",
"identifier": "TestOrcDataSourceUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMergeAdjacent()\n {\n List<DiskRange> diskRanges = mergeAdjacentDiskRanges(\n ImmutableList.of(new DiskRange(100, 100), new DiskRange(200, 100), new DiskRange(300, 100)),\n DataSize.ofBytes(0),\n DataSize.of(1, GIGABYTE));\n ... | {
"fields": [],
"file": "presto-orc/src/main/java/io/prestosql/orc/OrcDataSourceUtils.java",
"identifier": "OrcDataSourceUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrcDataSourceUtils.OrcDataSourceUtils()",
"constructor": true,
"full_signature": "private OrcDataS... | {
"body": "public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize)\n {\n // sort ranges by start offset\n List<DiskRange> ranges = new ArrayList<>(diskRanges);\n ranges.sort(comparingLong(DiskRange::getOffset));\n... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_858 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testLength()\n {\n assertFunction(\"LENGTH('')\", BIGINT, 0L);\n assertFunction(\"LENGTH('hello')\", BIGINT, 5L);\n assertFunction(\"LENGTH('Quadratically')\", BIGINT, 13L);\n //\n // Test length for non-ASCII\n assertFunction(\"LENGTH('he... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Count of code points of the given string\")\n @ScalarFunction\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.BIGINT)\n public static long length(@SqlType(\"varchar(x)\") Slice slice)\n {\n return countCodePoints(slice);\n }",
"class_method_signature": "String... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_6 | {
"fields": [],
"file": "presto-client/src/test/java/io/prestosql/client/TestIntervalDayTime.java",
"identifier": "TestIntervalDayTime",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFormat()\n {\n assertMillis(0, \"0 00:00:00.000\");\n assertMillis(1, \"0 00:00:00.001\");\n assertMillis(-1, \"-0 00:00:00.001\");\n\n assertMillis(toMillis(12, 13, 45, 56, 789), \"12 13:45:56.789\");\n assertMillis(toMillis(-12, -13, -45, -... | {
"fields": [
{
"declarator": "MILLIS_IN_SECOND = 1000",
"modifier": "private static final",
"original_string": "private static final long MILLIS_IN_SECOND = 1000;",
"type": "long",
"var_name": "MILLIS_IN_SECOND"
},
{
"declarator": "MILLIS_IN_MINUTE = 60 * MILLIS_IN_SEC... | {
"body": "public static long toMillis(long day, long hour, long minute, long second, long millis)\n {\n try {\n long value = millis;\n value = addExact(value, multiplyExact(day, MILLIS_IN_DAY));\n value = addExact(value, multiplyExact(hour, MILLIS_IN_HOUR));\n va... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_593 | {
"fields": [
{
"declarator": "tempDirectory",
"modifier": "private",
"original_string": "private Path tempDirectory;",
"type": "Path",
"var_name": "tempDirectory"
}
],
"file": "presto-hive-hadoop2/src/test/java/io/prestosql/plugin/hive/TestHiveHadoop2Plugin.java",
"identif... | {
"body": "@Test\n public void testImmutablePartitionsAndInsertOverwriteMutuallyExclusive()\n {\n Plugin plugin = new HiveHadoop2Plugin();\n ConnectorFactory connectorFactory = Iterables.getOnlyElement(plugin.getConnectorFactories());\n\n assertThatThrownBy(() -> connectorFactory.create(\n ... | {
"fields": [],
"file": "presto-hive-hadoop2/src/main/java/io/prestosql/plugin/hive/HiveHadoop2Plugin.java",
"identifier": "HiveHadoop2Plugin",
"interfaces": "implements Plugin",
"methods": [
{
"class_method_signature": "HiveHadoop2Plugin.getConnectorFactories()",
"constructor": false,
"... | {
"body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new HiveConnectorFactory(\"hive-hadoop2\"));\n }",
"class_method_signature": "HiveHadoop2Plugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Override public Itera... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_439 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestDecimals.java",
"identifier": "TestDecimals",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse()\n {\n assertParseResult(\"0\", 0L, 1, 0);\n assertParseResult(\"0.\", 0L, 1, 0);\n assertParseResult(\".0\", 0L, 1, 1);\n assertParseResult(\"+0\", 0L, 1, 0);\n assertParseResult(\"-0\", 0L, 1, 0);\n assertParseResult(\"000\", ... | {
"fields": [
{
"declarator": "MAX_PRECISION = 38",
"modifier": "public static final",
"original_string": "public static final int MAX_PRECISION = 38;",
"type": "int",
"var_name": "MAX_PRECISION"
},
{
"declarator": "MAX_SHORT_PRECISION = 18",
"modifier": "public s... | {
"body": "public static DecimalParseResult parse(String stringValue)\n {\n return parse(stringValue, false);\n }",
"class_method_signature": "Decimals.parse(String stringValue)",
"constructor": false,
"full_signature": "public static DecimalParseResult parse(String stringValue)",
"identifier": "... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1236 | {
"fields": [],
"file": "presto-pinot/src/test/java/io/prestosql/pinot/query/TestDynamicTable.java",
"identifier": "TestDynamicTable",
"interfaces": "",
"superclass": "extends TestPinotQueryBase"
} | {
"body": "@Test\n public void testFilterWithUdf()\n {\n String tableName = realtimeOnlyTable.getTableName();\n String query = format(\"select FlightNum from %s where DivLongestGTimes = POW(3, 2) limit 60\", tableName.toLowerCase(ENGLISH));\n DynamicTable dynamicTable = buildFromPql(pinotMe... | {
"fields": [
{
"declarator": "tableName",
"modifier": "private final",
"original_string": "private final String tableName;",
"type": "String",
"var_name": "tableName"
},
{
"declarator": "suffix",
"modifier": "private final",
"original_string": "private fina... | {
"body": "@JsonProperty\n public String getTableName()\n {\n return tableName;\n }",
"class_method_signature": "DynamicTable.getTableName()",
"constructor": false,
"full_signature": "@JsonProperty public String getTableName()",
"identifier": "getTableName",
"invocations": [],
"modifiers":... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_985 | {
"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 testTopN()\n {\n PlanNode node = new TopNNode(\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_655 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestTinyintOperators.java",
"identifier": "TestTinyintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testMultiply()\n {\n assertFunction(\"TINYINT'11' * TINYINT'11'\", TINYINT, (byte) (11 * 11));\n assertFunction(\"TINYINT'11' * TINYINT'9'\", TINYINT, (byte) (11 * 9));\n assertFunction(\"TINYINT'9' * TINYINT'11'\", TINYINT, (byte) (9 * 11));\n assertFu... | {
"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(MULTIPLY)\n @SqlType(StandardTypes.TINYINT)\n public static long multiply(@SqlType(StandardTypes.TINYINT) long left, @SqlType(StandardTypes.TINYINT) long right)\n {\n try {\n return SignedBytes.checkedCast(left * right);\n }\n catch (IllegalArgumentE... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_205 | {
"fields": [
{
"declarator": "BCRYPT_PASSWORD = \"$2y$10$BqTb8hScP5DfcpmHo5PeyugxHz5Ky/qf3wrpD7SNm8sWuA3VlGqsa\"",
"modifier": "private static final",
"original_string": "private static final String BCRYPT_PASSWORD = \"$2y$10$BqTb8hScP5DfcpmHo5PeyugxHz5Ky/qf3wrpD7SNm8sWuA3VlGqsa\";",
"typ... | {
"body": "@Test\n public void testAuthenticate()\n {\n PasswordStore store = createStore(\"userbcrypt:\" + BCRYPT_PASSWORD, \"userpbkdf2:\" + PBKDF2_PASSWORD);\n\n assertTrue(store.authenticate(\"userbcrypt\", \"user123\"));\n assertFalse(store.authenticate(\"userbcrypt\", \"user999\"));\n... | {
"fields": [
{
"declarator": "LINE_SPLITTER = Splitter.on(\":\").limit(2)",
"modifier": "private static final",
"original_string": "private static final Splitter LINE_SPLITTER = Splitter.on(\":\").limit(2);",
"type": "Splitter",
"var_name": "LINE_SPLITTER"
},
{
"declar... | {
"body": "public boolean authenticate(String user, String password)\n {\n return cache.getUnchecked(new Credential(user, password));\n }",
"class_method_signature": "PasswordStore.authenticate(String user, String password)",
"constructor": false,
"full_signature": "public boolean authenticate(Stri... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_710 | {
"fields": [
{
"declarator": "nodeInfo = new NodeInfo(\"test\")",
"modifier": "private final",
"original_string": "private final NodeInfo nodeInfo = new NodeInfo(\"test\");",
"type": "NodeInfo",
"var_name": "nodeInfo"
},
{
"declarator": "internalCommunicationConfig = n... | {
"body": "@Test\n public void testGetCurrentNode()\n {\n NodeInfo nodeInfo = new NodeInfo(new NodeConfig()\n .setEnvironment(\"test\")\n .setNodeId(currentNode.getNodeIdentifier()));\n\n DiscoveryNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new ... | {
"fields": [
{
"declarator": "log = Logger.get(DiscoveryNodeManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(DiscoveryNodeManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "CONN... | {
"body": "@Override\n public InternalNode getCurrentNode()\n {\n return currentNode;\n }",
"class_method_signature": "DiscoveryNodeManager.getCurrentNode()",
"constructor": false,
"full_signature": "@Override public InternalNode getCurrentNode()",
"identifier": "getCurrentNode",
"invocation... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_340 | {
"fields": [
{
"declarator": "TEST_CATALOG = \"test_catalog\"",
"modifier": "private static final",
"original_string": "private static final String TEST_CATALOG = \"test_catalog\";",
"type": "String",
"var_name": "TEST_CATALOG"
},
{
"declarator": "COUNTING_CATALOG = \"... | {
"body": "@Test\n public void testGetCatalogs()\n throws Exception\n {\n try (Connection connection = createConnection()) {\n try (ResultSet rs = connection.getMetaData().getCatalogs()) {\n assertThat(readRows(rs))\n .isEqualTo(list(list(\"blac... | {
"fields": [
{
"declarator": "SEARCH_STRING_ESCAPE = \"\\\\\"",
"modifier": "private static final",
"original_string": "private static final String SEARCH_STRING_ESCAPE = \"\\\\\";",
"type": "String",
"var_name": "SEARCH_STRING_ESCAPE"
},
{
"declarator": "connection",
... | {
"body": "@Override\n public ResultSet getCatalogs()\n throws SQLException\n {\n return select(\"\" +\n \"SELECT TABLE_CAT\\n\" +\n \"FROM system.jdbc.catalogs\\n\" +\n \"ORDER BY TABLE_CAT\");\n }",
"class_method_signature": "PrestoDatabaseMe... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_194 | {
"fields": [
{
"declarator": "forReal",
"modifier": "private",
"original_string": "private boolean forReal;",
"type": "boolean",
"var_name": "forReal"
},
{
"declarator": "successResponse = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><soapenv:Envelope xmlns:soap... | {
"body": "@Test\n public void createAuthenticatedPrincipalAllOrgs()\n {\n String org = \"all\"; // As if from salesforce.allowed-organizations property.\n String username = \"user@salesforce.com\";\n String password = \"passtoken\";\n\n SalesforceConfig config = new SalesforceConfi... | {
"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_897 | {
"fields": [
{
"declarator": "scheduledExecutor",
"modifier": "private",
"original_string": "private ScheduledExecutorService scheduledExecutor;",
"type": "ScheduledExecutorService",
"var_name": "scheduledExecutor"
}
],
"file": "presto-main/src/test/java/io/prestosql/operato... | {
"body": "@Test(timeOut = 10_000)\n public void testWorkProcessorPipelineSourceOperator()\n throws InterruptedException\n {\n Split split = createSplit();\n\n Page page1 = createPage(1);\n Page page2 = createPage(2);\n Page page3 = createPage(3);\n Page page4 = cre... | {
"fields": [
{
"declarator": "log = Logger.get(WorkProcessorPipelineSourceOperator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(WorkProcessorPipelineSourceOperator.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "private WorkProcessorPipelineSourceOperator(\n int operatorId,\n DriverContext driverContext,\n WorkProcessorSourceOperatorFactory sourceOperatorFactory,\n List<WorkProcessorOperatorFactory> operatorFactories)\n {\n requireNonNull(driverContext, \"drive... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1261 | {
"fields": [],
"file": "presto-orc/src/test/java/io/prestosql/orc/stream/TestBooleanOutputStream.java",
"identifier": "TestBooleanOutputStream",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWriteBoolean()\n {\n List<List<Integer>> testGroups = ImmutableList.of(\n ImmutableList.of(149, 317, 2),\n ImmutableList.of(2),\n ImmutableList.of(1, 2, 4, 0, 8),\n ImmutableList.of(1, 4, 8, 1024, 10000),\n ... | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(BooleanOutputStream.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final int INSTANCE_SIZE = ClassLayout.parseClass(BooleanOutputStream.class).instanceSize();",
"type": "in... | {
"body": "public void writeBoolean(boolean value)\n {\n checkState(!closed);\n\n if (value) {\n data |= 0x1 << (7 - bitsInData);\n }\n bitsInData++;\n\n if (bitsInData == 8) {\n flushData();\n }\n }",
"class_method_signature": "BooleanOutputStre... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_878 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testCharUpper()\n {\n assertFunction(\"UPPER(CAST('' AS CHAR(10)))\", createCharType(10), padRight(\"\", 10));\n assertFunction(\"UPPER(CAST('Hello World' AS CHAR(11)))\", createCharType(11), padRight(\"HELLO WORLD\", 11));\n assertFunction(\"UPPER(CAST('what!... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/StringFunctions.java",
"identifier": "StringFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringFunctions.StringFunctions()",
"constructor": true,
"full_signature": "private StringF... | {
"body": "@Description(\"Converts the string to upper case\")\n @ScalarFunction(\"upper\")\n @LiteralParameters(\"x\")\n @SqlType(\"char(x)\")\n public static Slice charUpper(@SqlType(\"char(x)\") Slice slice)\n {\n return upper(slice);\n }",
"class_method_signature": "StringFunctions.char... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_481 | {
"fields": [
{
"declarator": "A = new TestingColumnHandle(\"a\")",
"modifier": "private static final",
"original_string": "private static final ColumnHandle A = new TestingColumnHandle(\"a\");",
"type": "ColumnHandle",
"var_name": "A"
},
{
"declarator": "B = new Testin... | {
"body": "@Test\n public void testAll()\n {\n assertTrue(TupleDomain.all().isAll());\n assertEquals(TupleDomain.<ColumnHandle>all(),\n TupleDomain.withColumnDomains(ImmutableMap.of(\n A, Domain.all(BIGINT))));\n assertEquals(TupleDomain.<ColumnHandle>a... | {
"fields": [
{
"declarator": "NONE = new TupleDomain<>(Optional.empty())",
"modifier": "private static final",
"original_string": "private static final TupleDomain<?> NONE = new TupleDomain<>(Optional.empty());",
"type": "TupleDomain<?>",
"var_name": "NONE"
},
{
"decla... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <T> TupleDomain<T> all()\n {\n return (TupleDomain<T>) ALL;\n }",
"class_method_signature": "TupleDomain.all()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static TupleDomain<T> all()",
"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_1148 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testNoTransactionCommit()\n {\n TransactionManager transactionManager = createTestTransactionManager();\n\n Session session = sessionBuilder()\n .build();\n QueryStateMachine stateMachine = createQueryStateMachine(\"COMMIT\", session, transactio... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/CommitTask.java",
"identifier": "CommitTask",
"interfaces": "implements DataDefinitionTask<Commit>",
"methods": [
{
"class_method_signature": "CommitTask.getName()",
"constructor": false,
"full_signature": "@Overri... | {
"body": "@Override\n public ListenableFuture<?> execute(Commit statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (session.getTransa... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_252 | {
"fields": [
{
"declarator": "UTC_CHRONOLOGY = ISOChronology.getInstanceUTC()",
"modifier": "private static final",
"original_string": "private static final ISOChronology UTC_CHRONOLOGY = ISOChronology.getInstanceUTC();",
"type": "ISOChronology",
"var_name": "UTC_CHRONOLOGY"
},
... | {
"body": "@Test\n public void testMaxFileSize()\n {\n List<Long> columnIds = ImmutableList.of(3L, 7L);\n List<Type> columnTypes = ImmutableList.of(BIGINT, createVarcharType(5));\n\n List<Page> pages = rowPagesBuilder(columnTypes)\n .row(123L, \"hello\")\n .row... | {
"fields": [
{
"declarator": "SHARD_DELTA_CODEC = jsonCodec(ShardDelta.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<ShardDelta> SHARD_DELTA_CODEC = jsonCodec(ShardDelta.class);",
"type": "JsonCodec<ShardDelta>",
"var_name": "SHARD_D... | {
"body": "@Override\n public StoragePageSink createStoragePageSink(long transactionId, OptionalInt bucketNumber, List<Long> columnIds, List<Type> columnTypes, boolean checkSpace)\n {\n if (checkSpace && storageService.getAvailableBytes() < minAvailableSpace.toBytes()) {\n throw new PrestoExce... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_602 | {
"fields": [
{
"declarator": "COL1 = new MongoColumnHandle(\"col1\", BIGINT, false)",
"modifier": "private static final",
"original_string": "private static final MongoColumnHandle COL1 = new MongoColumnHandle(\"col1\", BIGINT, false);",
"type": "MongoColumnHandle",
"var_name": "COL... | {
"body": "@Test\n public void testBuildQueryStringType()\n {\n TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(\n COL3, Domain.create(ValueSet.ofRanges(range(createUnboundedVarcharType(), utf8Slice(\"hello\"), false, utf8Slice(\"world\"), true)), fals... | {
"fields": [
{
"declarator": "log = Logger.get(MongoSession.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(MongoSession.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "SYSTEM_TABLES = Arra... | {
"body": "@VisibleForTesting\n static Document buildQuery(TupleDomain<ColumnHandle> tupleDomain)\n {\n Document query = new Document();\n if (tupleDomain.getDomains().isPresent()) {\n for (Map.Entry<ColumnHandle, Domain> entry : tupleDomain.getDomains().get().entrySet()) {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_317 | {
"fields": [
{
"declarator": "exampleHttpServer",
"modifier": "private",
"original_string": "private ExampleHttpServer exampleHttpServer;",
"type": "ExampleHttpServer",
"var_name": "exampleHttpServer"
},
{
"declarator": "dataUri",
"modifier": "private",
"or... | {
"body": "@Test\n public void testCursorMixedOrder()\n {\n RecordSet recordSet = new ExampleRecordSet(new ExampleSplit(dataUri), ImmutableList.of(\n new ExampleColumnHandle(\"value\", BIGINT, 1),\n new ExampleColumnHandle(\"value\", BIGINT, 1),\n new ExampleC... | {
"fields": [
{
"declarator": "columnHandles",
"modifier": "private final",
"original_string": "private final List<ExampleColumnHandle> columnHandles;",
"type": "List<ExampleColumnHandle>",
"var_name": "columnHandles"
},
{
"declarator": "columnTypes",
"modifier": ... | {
"body": "@Override\n public RecordCursor cursor()\n {\n return new ExampleRecordCursor(columnHandles, byteSource);\n }",
"class_method_signature": "ExampleRecordSet.cursor()",
"constructor": false,
"full_signature": "@Override public RecordCursor cursor()",
"identifier": "cursor",
"invocat... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_747 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private static final",
"original_string": "private static final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "LONG_AV... | {
"body": "@Test(dataProvider = \"hashEnabledAndMemoryLimitForMergeValues\")\n public void testHashAggregationMemoryReservation(boolean hashEnabled, boolean spillEnabled, boolean revokeMemoryWhenAddingPages, long memoryLimitForMerge, long memoryLimitForMergeWithMemory)\n {\n Metadata metadata = createTes... | {
"fields": [
{
"declarator": "MERGE_WITH_MEMORY_RATIO = 0.9",
"modifier": "private static final",
"original_string": "private static final double MERGE_WITH_MEMORY_RATIO = 0.9;",
"type": "double",
"var_name": "MERGE_WITH_MEMORY_RATIO"
},
{
"declarator": "operatorContex... | {
"body": "@Override\n public OperatorContext getOperatorContext()\n {\n return operatorContext;\n }",
"class_method_signature": "HashAggregationOperator.getOperatorContext()",
"constructor": false,
"full_signature": "@Override public OperatorContext getOperatorContext()",
"identifier": "getOp... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_881 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestStringFunctions.java",
"identifier": "TestStringFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testNormalize()\n {\n assertFunction(\"normalize('sch\\u00f6n', NFD)\", VARCHAR, \"scho\\u0308n\");\n assertFunction(\"normalize('sch\\u00f6n')\", VARCHAR, \"sch\\u00f6n\");\n assertFunction(\"normalize('sch\\u00f6n', NFC)\", VARCHAR, \"sch\\u00f6n\");\n ... | {
"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(\"Transforms the string to normalized form\")\n @ScalarFunction\n @LiteralParameters({\"x\", \"y\"})\n @SqlType(StandardTypes.VARCHAR)\n public static Slice normalize(@SqlType(\"varchar(x)\") Slice slice, @SqlType(\"varchar(y)\") Slice form)\n {\n Normalizer.Form targetFo... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_182 | {
"fields": [
{
"declarator": "TEST_COLUMN_HANDLE = createBaseColumn(\n \"test\",\n 0,\n HiveType.HIVE_STRING,\n VARCHAR,\n HiveColumnHandle.ColumnType.PARTITION_KEY,\n Optional.empty())",
"modifier": "private static final",
"orig... | {
"body": "@Test(timeOut = 10_000)\n public void testCreatePredicate()\n {\n ImmutableList.Builder<HivePartition> partitions = ImmutableList.builder();\n\n for (int i = 0; i < 5_000; i++) {\n partitions.add(new HivePartition(\n new SchemaTableName(\"test\", \"test\"),... | {
"fields": [
{
"declarator": "PRESTO_VERSION_NAME = \"presto_version\"",
"modifier": "public static final",
"original_string": "public static final String PRESTO_VERSION_NAME = \"presto_version\";",
"type": "String",
"var_name": "PRESTO_VERSION_NAME"
},
{
"declarator":... | {
"body": "@VisibleForTesting\n static TupleDomain<ColumnHandle> createPredicate(List<ColumnHandle> partitionColumns, List<HivePartition> partitions)\n {\n if (partitions.isEmpty()) {\n return TupleDomain.none();\n }\n\n return withColumnDomains(\n partitionColumns... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_478 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestAllOrNoneValueSet.java",
"identifier": "TestAllOrNoneValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComplement()\n {\n AllOrNoneValueSet all = AllOrNoneValueSet.all(HYPER_LOG_LOG);\n AllOrNoneValueSet none = AllOrNoneValueSet.none(HYPER_LOG_LOG);\n\n assertEquals(all.complement(), none);\n assertEquals(none.complement(), all);\n }",
"class_me... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "all",
"modifier": "private final",
"original_string": "private final boolean all;",
... | {
"body": "@Override\n public ValueSet complement()\n {\n return new AllOrNoneValueSet(type, !all);\n }",
"class_method_signature": "AllOrNoneValueSet.complement()",
"constructor": false,
"full_signature": "@Override public ValueSet complement()",
"identifier": "complement",
"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_497 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/predicate/TestRange.java",
"identifier": "TestRange",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSingleValue()\n {\n assertEquals(Range.equal(BIGINT, 0L).getSingleValue(), 0L);\n try {\n Range.lessThan(BIGINT, 0L).getSingleValue();\n fail();\n }\n catch (IllegalStateException e) {\n }\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "low",
"modifier": "private final",
"original_string": "private final Marker low;",
"type": "Marker",
"var_name": "low"
},
{
"declarator": "high",
"modifier": "private final",
"original_string": "private final Marker high;",
... | {
"body": "public Object getSingleValue()\n {\n if (!isSingleValue()) {\n throw new IllegalStateException(\"Range does not have just a single value\");\n }\n return low.getValue();\n }",
"class_method_signature": "Range.getSingleValue()",
"constructor": false,
"full_signatu... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1277 | {
"fields": [
{
"declarator": "NO_CREATED_BY = Optional.empty()",
"modifier": "private static final",
"original_string": "private static final Optional<String> NO_CREATED_BY = Optional.empty();",
"type": "Optional<String>",
"var_name": "NO_CREATED_BY"
},
{
"declarator":... | {
"body": "@Test(dataProvider = \"allCreatedBy\")\n public void testReadStatsInt64(Optional<String> fileCreatedBy)\n {\n Statistics statistics = new Statistics();\n statistics.setNull_count(13);\n statistics.setMin(fromHex(\"F6FFFFFFFFFFFFFF\"));\n statistics.setMax(fromHex(\"3AA4000... | {
"fields": [
{
"declarator": "MAGIC = Slices.utf8Slice(\"PAR1\")",
"modifier": "private static final",
"original_string": "private static final Slice MAGIC = Slices.utf8Slice(\"PAR1\");",
"type": "Slice",
"var_name": "MAGIC"
},
{
"declarator": "POST_SCRIPT_SIZE = Integ... | {
"body": "public static org.apache.parquet.column.statistics.Statistics<?> readStats(Optional<String> fileCreatedBy, Optional<Statistics> statisticsFromFile, PrimitiveType type)\n {\n Statistics statistics = statisticsFromFile.orElse(null);\n org.apache.parquet.column.statistics.Statistics<?> column... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_614 | {
"fields": [
{
"declarator": "lowMemoryKiller = new TotalReservationLowMemoryKiller()",
"modifier": "private final",
"original_string": "private final LowMemoryKiller lowMemoryKiller = new TotalReservationLowMemoryKiller();",
"type": "LowMemoryKiller",
"var_name": "lowMemoryKiller"
... | {
"body": "@Test\n public void testSkewedQuery()\n {\n int reservePool = 10;\n int generalPool = 12;\n // q2 is the query with the most total memory reservation, but not the query with the max memory reservation.\n // This also tests the corner case where a node doesn't have a genera... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/memory/TotalReservationLowMemoryKiller.java",
"identifier": "TotalReservationLowMemoryKiller",
"interfaces": "implements LowMemoryKiller",
"methods": [
{
"class_method_signature": "TotalReservationLowMemoryKiller.chooseQueryToKill(List<... | {
"body": "@Override\n public Optional<QueryId> chooseQueryToKill(List<QueryMemoryInfo> runningQueries, List<MemoryInfo> nodes)\n {\n QueryId biggestQuery = null;\n long maxMemory = 0;\n for (QueryMemoryInfo query : runningQueries) {\n long bytesUsed = query.getMemoryReservation(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_244 | {
"fields": [
{
"declarator": "METADATA_CODEC = jsonCodec(OrcFileMetadata.class)",
"modifier": "private static final",
"original_string": "private static final JsonCodec<OrcFileMetadata> METADATA_CODEC = jsonCodec(OrcFileMetadata.class);",
"type": "JsonCodec<OrcFileMetadata>",
"var_n... | {
"body": "@Test\n public void testRewriteWithoutMetadata()\n throws Exception\n {\n List<Long> columnIds = ImmutableList.of(3L, 7L);\n List<Type> columnTypes = ImmutableList.of(BIGINT, createVarcharType(20));\n\n File file = new File(temporary, randomUUID().toString());\n ... | {
"fields": [
{
"declarator": "log = Logger.get(OrcFileRewriter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(OrcFileRewriter.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "CONFIGURATION ... | {
"body": "public static OrcFileInfo rewrite(File input, File output, BitSet rowsToDelete)\n throws IOException\n {\n try (FileSystem fileSystem = new SyncingFileSystem(CONFIGURATION)) {\n Reader reader = createReader(fileSystem, path(input));\n\n if (reader.getNumberOfRows(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_751 | {
"fields": [
{
"declarator": "scheduler",
"modifier": "private",
"original_string": "private ScheduledExecutorService scheduler;",
"type": "ScheduledExecutorService",
"var_name": "scheduler"
},
{
"declarator": "pageBufferClientCallbackExecutor",
"modifier": "priv... | {
"body": "@Test\n public void testHappyPath()\n throws Exception\n {\n Page expectedPage = new Page(100);\n\n DataSize expectedMaxSize = DataSize.of(11, Unit.MEGABYTE);\n MockExchangeRequestProcessor processor = new MockExchangeRequestProcessor(expectedMaxSize);\n\n Cycli... | {
"fields": [
{
"declarator": "log = Logger.get(HttpPageBufferClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(HttpPageBufferClient.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "self... | {
"body": "public synchronized void scheduleRequest()\n {\n if (closed || (future != null) || scheduled) {\n return;\n }\n scheduled = true;\n\n // start before scheduling to include error delay\n backoff.startRequest();\n\n long delayNanos = backoff.getBackoffD... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_301 | {
"fields": [
{
"declarator": "JMX_STATS_DUMP = new Duration(100, TimeUnit.MILLISECONDS)",
"modifier": "private static final",
"original_string": "private static final Duration JMX_STATS_DUMP = new Duration(100, TimeUnit.MILLISECONDS);",
"type": "Duration",
"var_name": "JMX_STATS_DUM... | {
"body": "@Test\n public void testNoPredicate()\n throws Exception\n {\n JmxTableHandle tableHandle = new JmxTableHandle(new SchemaTableName(\"schema\", \"tableName\"), ImmutableList.of(\"objectName\"), ImmutableList.of(columnHandle), true, TupleDomain.all());\n ConnectorSplitSource sp... | {
"fields": [
{
"declarator": "nodeManager",
"modifier": "private final",
"original_string": "private final NodeManager nodeManager;",
"type": "NodeManager",
"var_name": "nodeManager"
}
],
"file": "presto-jmx/src/main/java/io/prestosql/plugin/jmx/JmxSplitManager.java",
"ide... | {
"body": "@Override\n public ConnectorSplitSource getSplits(\n ConnectorTransactionHandle transaction,\n ConnectorSession session,\n ConnectorTableHandle table,\n SplitSchedulingStrategy splitSchedulingStrategy,\n DynamicFilter dynamicFilter)\n {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_585 | {
"fields": [],
"file": "presto-base-jdbc/src/test/java/io/prestosql/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java",
"identifier": "TestConfigFileBasedCredentialProviderConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n throws IOException\n {\n Path credentialFile = Files.createTempFile(null, null);\n\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"connection-credential-file\", credenti... | {
"fields": [
{
"declarator": "credentialsFile",
"modifier": "private",
"original_string": "private String credentialsFile;",
"type": "String",
"var_name": "credentialsFile"
}
],
"file": "presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/credential/file/ConfigFileBasedC... | {
"body": "@Config(\"connection-credential-file\")\n @ConfigDescription(\"Location of the file where credentials are present\")\n public ConfigFileBasedCredentialProviderConfig setCredentialFile(String connectionUser)\n {\n this.credentialsFile = connectionUser;\n return this;\n }",
"class... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_993 | {
"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 testInnerJoinPropagatesPredicatesViaEquiConditions()\n {\n Map<Symbol, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C)));\n TableScanNode leftScan = tableScanNode(leftAssignments);\n\n Map<Symbol, Column... | {
"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_1220 | {
"fields": [
{
"declarator": "OUT = new OutputBufferId(0)",
"modifier": "public static final",
"original_string": "public static final OutputBufferId OUT = new OutputBufferId(0);",
"type": "OutputBufferId",
"var_name": "OUT"
},
{
"declarator": "CONNECTOR_ID = TEST_TABL... | {
"body": "@Test\n public void testScheduleSplitsBatched()\n {\n StageExecutionPlan plan = createPlan(createFixedSplitSource(60, TestingSplit::createRemoteSplit));\n NodeTaskMap nodeTaskMap = new NodeTaskMap(finalizerService);\n SqlStageExecution stage = createSqlStageExecution(plan, nodeTa... | {
"fields": [
{
"declarator": "stage",
"modifier": "private final",
"original_string": "private final SqlStageExecution stage;",
"type": "SqlStageExecution",
"var_name": "stage"
},
{
"declarator": "splitSource",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public synchronized ScheduleResult schedule()\n {\n dropListenersFromWhenFinishedOrNewLifespansAdded();\n\n int overallSplitAssignmentCount = 0;\n ImmutableSet.Builder<RemoteTask> overallNewTasks = ImmutableSet.builder();\n List<ListenableFuture<?>> overallBloc... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_839 | {
"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 testTanh()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"tanh(\" + doubleValue + \")\", DOUBLE, Math.tanh(doubleValue));\n assertFunction(\"tanh(REAL '\" + doubleValue + \"')\", DOUBLE, Math.tanh((float) doubleValue));\n }\... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Hyperbolic tangent\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double tanh(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.tanh(num);\n }",
"class_method_signature": "MathFunctions.tanh(@SqlType(StandardTypes.DOUBLE) double 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... |
166515022_1109 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/server/remotetask/TestBackoff.java",
"identifier": "TestBackoff",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testStartRequest()\n {\n TestingTicker ticker = new TestingTicker();\n ticker.increment(1, NANOSECONDS);\n\n Backoff backoff = new Backoff(1, new Duration(15, SECONDS), ticker, ImmutableList.of(new Duration(10, MILLISECONDS)));\n ticker.increment(10, MI... | {
"fields": [
{
"declarator": "MIN_RETRIES = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_RETRIES = 3;",
"type": "int",
"var_name": "MIN_RETRIES"
},
{
"declarator": "DEFAULT_BACKOFF_DELAY_INTERVALS = ImmutableList.<Duration>bu... | {
"body": "public synchronized void startRequest()\n {\n lastRequestStart = ticker.read();\n }",
"class_method_signature": "Backoff.startRequest()",
"constructor": false,
"full_signature": "public synchronized void startRequest()",
"identifier": "startRequest",
"invocations": [
"read"
],
... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_213 | {
"fields": [],
"file": "presto-raptor-legacy/src/test/java/io/prestosql/plugin/raptor/legacy/backup/TestHttpBackupConfig.java",
"identifier": "TestHttpBackupConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"backup.http.uri\", \"http://example.net:8080\")\n .build();\n\n HttpBackupConfig expected = new HttpBackupConfig()\... | {
"fields": [
{
"declarator": "uri",
"modifier": "private",
"original_string": "private URI uri;",
"type": "URI",
"var_name": "uri"
}
],
"file": "presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/backup/HttpBackupConfig.java",
"identifier": "HttpBackupCon... | {
"body": "@Config(\"backup.http.uri\")\n @ConfigDescription(\"Backup service base URI\")\n public HttpBackupConfig setUri(URI uri)\n {\n this.uri = uri;\n return this;\n }",
"class_method_signature": "HttpBackupConfig.setUri(URI uri)",
"constructor": false,
"full_signature": "@Config(... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_643 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestBigintOperators.java",
"identifier": "TestBigintOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testAdd()\n {\n assertFunction(\"37 + 100000000037\", BIGINT, 37 + 100000000037L);\n assertFunction(\"37 + 100000000017\", BIGINT, 37 + 100000000017L);\n assertFunction(\"100000000017 + 37\", BIGINT, 100000000017L + 37L);\n assertFunction(\"100000000017... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/type/BigintOperators.java",
"identifier": "BigintOperators",
"interfaces": "",
"methods": [
{
"class_method_signature": "BigintOperators.BigintOperators()",
"constructor": true,
"full_signature": "private BigintOperators()"... | {
"body": "@ScalarOperator(ADD)\n @SqlType(StandardTypes.BIGINT)\n public static long add(@SqlType(StandardTypes.BIGINT) long left, @SqlType(StandardTypes.BIGINT) long right)\n {\n try {\n return Math.addExact(left, right);\n }\n catch (ArithmeticException e) {\n th... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_356 | {
"fields": [
{
"declarator": "ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\")",
"modifier": "private static final",
"original_string": "private static final DateTimeZone ASIA_ORAL_ZONE = DateTimeZone.forID(\"Asia/Oral\");",
"type": "DateTimeZone",
"var_name": "ASIA_ORAL_ZONE"
... | {
"body": "@Test\n public void testConnectionResourceHandling()\n throws Exception\n {\n List<Connection> connections = new ArrayList<>();\n\n for (int i = 0; i < 100; i++) {\n Connection connection = createConnection();\n connections.add(connection);\n\n ... | {
"fields": [
{
"declarator": "DRIVER_NAME = \"Presto JDBC Driver\"",
"modifier": "static final",
"original_string": "static final String DRIVER_NAME = \"Presto JDBC Driver\";",
"type": "String",
"var_name": "DRIVER_NAME"
},
{
"declarator": "DRIVER_VERSION",
"modi... | {
"body": "@Override\n public void close()\n {\n httpClient.dispatcher().executorService().shutdown();\n httpClient.connectionPool().evictAll();\n }",
"class_method_signature": "PrestoDriver.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier":... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_706 | {
"fields": [
{
"declarator": "PRINCIPAL = new BasicPrincipal(\"principal\")",
"modifier": "private static final",
"original_string": "private static final Principal PRINCIPAL = new BasicPrincipal(\"principal\");",
"type": "Principal",
"var_name": "PRINCIPAL"
},
{
"decl... | {
"body": "@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = \"Presto server is still initializing\")\n public void testInitializing()\n {\n AccessControlManager accessControlManager = createAccessControlManager(createTestTransactionManager());\n accessControlMana... | {
"fields": [
{
"declarator": "log = Logger.get(AccessControlManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(AccessControlManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "CONF... | {
"body": "@Override\n @Deprecated\n public void checkCanSetUser(Optional<Principal> principal, String userName)\n {\n requireNonNull(principal, \"principal is null\");\n requireNonNull(userName, \"userName is null\");\n\n systemAuthorizationCheck(control -> control.checkCanSetUser(princ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_842 | {
"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 testWidthBucket()\n {\n assertFunction(\"width_bucket(3.14E0, 0, 4, 3)\", BIGINT, 3L);\n assertFunction(\"width_bucket(2, 0, 4, 3)\", BIGINT, 2L);\n assertFunction(\"width_bucket(infinity(), 0, 4, 3)\", BIGINT, 4L);\n assertFunction(\"width_bucket(-1, 0... | {
"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(\"The bucket number of a value given a lower and upper bound and the number of buckets\")\n @ScalarFunction(\"width_bucket\")\n @SqlType(StandardTypes.BIGINT)\n public static long widthBucket(@SqlType(StandardTypes.DOUBLE) double operand, @SqlType(StandardTypes.DOUBLE) double bound1, ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_37 | {
"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 testTableRulesForCheckCanRenameColumn()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-table.json\");\n\n accessControl.checkCanRenameColumn(ADMIN, new CatalogSchemaTableName(\"some-catalog\", \"bobschema\", \"bob... | {
"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 checkCanRenameColumn(SystemSecurityContext context, CatalogSchemaTableName table)\n {\n if (!checkTablePermission(context, table, OWNERSHIP)) {\n denyRenameColumn(table.toString());\n }\n }",
"class_method_signature": "FileBasedSystemAccessControl... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_511 | {
"fields": [],
"file": "presto-cli/src/test/java/io/prestosql/cli/TestClientOptions.java",
"identifier": "TestClientOptions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTraceToken()\n {\n Console console = createConsole(\"--trace-token\", \"test token\");\n ClientSession session = console.clientOptions.toClientSession();\n assertEquals(session.getTraceToken(), Optional.of(\"test token\"));\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "NAME_VALUE_SPLITTER = Splitter.on('=').limit(2)",
"modifier": "private static final",
"original_string": "private static final Splitter NAME_VALUE_SPLITTER = Splitter.on('=').limit(2);",
"type": "Splitter",
"var_name": "NAME_VALUE_SPLITTER"
},
{... | {
"body": "public ClientSession toClientSession()\n {\n return new ClientSession(\n parseServer(server),\n user,\n source,\n Optional.ofNullable(traceToken),\n parseClientTags(nullToEmpty(clientTags)),\n clientInfo,\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_141 | {
"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 testCalculateNullsFraction()\n {\n assertEquals(calculateNullsFraction(COLUMN, ImmutableList.of()), Estimate.unknown());\n assertEquals(calculateNullsFraction(COLUMN, ImmutableList.of(PartitionStatistics.empty())), Estimate.unknown());\n assertEquals(calculate... | {
"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 calculateNullsFraction(String column, Collection<PartitionStatistics> partitionStatistics)\n {\n List<PartitionStatistics> statisticsWithKnownRowCountAndNullsCount = partitionStatistics.stream()\n .filter(statistics -> {\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_454 | {
"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 testOverflows()\n {\n assertTrue(overflows(unscaledDecimal(\"100\"), 2));\n assertTrue(overflows(unscaledDecimal(\"-100\"), 2));\n assertFalse(overflows(unscaledDecimal(\"99\"), 2));\n assertFalse(overflows(unscaledDecimal(\"-99\"), 2));\n }",
"cla... | {
"fields": [
{
"declarator": "NUMBER_OF_LONGS = 2",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_LONGS = 2;",
"type": "int",
"var_name": "NUMBER_OF_LONGS"
},
{
"declarator": "NUMBER_OF_INTS = 2 * NUMBER_OF_LONGS",
"mo... | {
"body": "public static boolean overflows(Slice value, int precision)\n {\n if (precision == MAX_PRECISION) {\n return exceedsOrEqualTenToThirtyEight(value);\n }\n return precision < MAX_PRECISION && compareAbsolute(value, POWERS_OF_TEN[precision]) >= 0;\n }",
"class_method_si... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_907 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortProperties()\n {\n List<LocalProperty<String>> actual = builder()\n .sorted(\"a\", SortOrder.ASC_NULLS_FIRST)\n .sorted(\"b\", SortOrder.ASC_NULLS_FIRST)\n .sorted(\"c\", SortOrder.ASC_NULLS_FIRST)\n .build... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/optimizations/LocalProperties.java",
"identifier": "LocalProperties",
"interfaces": "",
"methods": [
{
"class_method_signature": "LocalProperties.LocalProperties()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static <T> List<LocalProperty<T>> grouped(Collection<T> columns)\n {\n return ImmutableList.of(new GroupingProperty<>(columns));\n }",
"class_method_signature": "LocalProperties.grouped(Collection<T> columns)",
"constructor": false,
"full_signature": "public static List<LocalPrope... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_287 | {
"fields": [],
"file": "presto-thrift-api/src/test/java/io/prestosql/plugin/thrift/api/datatypes/TestPrestoThriftBigint.java",
"identifier": "TestPrestoThriftBigint",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadBlockAllNonNullOption1()\n {\n PrestoThriftBlock columnsData = longColumn(\n null,\n new long[] {2, 7, 1, 3, 8, 4, 5});\n Block actual = columnsData.toBlock(BIGINT);\n assertBlockEquals(actual, list(2L, 7L, 1L, 3L, 8L, 4L,... | {
"fields": [
{
"declarator": "nulls",
"modifier": "private final",
"original_string": "private final boolean[] nulls;",
"type": "boolean[]",
"var_name": "nulls"
},
{
"declarator": "longs",
"modifier": "private final",
"original_string": "private final long[... | {
"body": "@Override\n public Block toBlock(Type desiredType)\n {\n checkArgument(BIGINT.equals(desiredType), \"type doesn't match: %s\", desiredType);\n int numberOfRecords = numberOfRecords();\n return new LongArrayBlock(\n numberOfRecords,\n Optional.ofNulla... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1037 | {
"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 testCommit()\n {\n analyze(\"COMMIT\");\n analyze(\"COMMIT WORK\");\n }",
"class_method_signature": "TestAnalyzer.testCommit()",
"constructor": false,
"full_signature": "@Test public void testCommit()",
"identifier": "testCommit",
"invocations": [
"a... | {
"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_1172 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "executor = newCachedT... | {
"body": "@Test\n public void testNestedTransaction()\n {\n TransactionManager transactionManager = createTestTransactionManager();\n Session session = sessionBuilder()\n .setTransactionId(TransactionId.create())\n .setClientTransactionSupport()\n .bui... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/execution/StartTransactionTask.java",
"identifier": "StartTransactionTask",
"interfaces": "implements DataDefinitionTask<StartTransaction>",
"methods": [
{
"class_method_signature": "StartTransactionTask.getName()",
"constructor":... | {
"body": "@Override\n public ListenableFuture<?> execute(StartTransaction statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)\n {\n Session session = stateMachine.getSession();\n if (!sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_792 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testFromBigEndian64()\n {\n assertFunction(\"from_big_endian_64(from_hex('0000000000000000'))\", BIGINT, 0L);\n assertFunction(\"from_big_endian_64(from_hex('0000000000000001'))\", BIGINT, 1L);\n assertFunction(\"from_big_endian_64(from_hex('7FFFFFFFFFFFFFFF')... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Decode bigint value from a 64-bit 2's complement big endian varbinary\")\n @ScalarFunction(\"from_big_endian_64\")\n @SqlType(StandardTypes.BIGINT)\n public static long fromBigEndian64(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n if (slice.length() != Long.BYTES) {... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_268 | {
"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 testTableDiscovery()\n throws Exception\n {\n long table1 = metadataDao.insertTable(\"schema\", \"table1\", false, true, null, 0);\n metadataDao.insertColumn(table1, 1, \"foo\", 1, \"bigint\", 1, null);\n\n long table2 = metadataDao.insertTable(\"sc... | {
"fields": [
{
"declarator": "log = Logger.get(ShardOrganizationManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(ShardOrganizationManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@VisibleForTesting\n Set<Long> discoverAndInitializeTablesToOrganize()\n {\n Set<Long> enabledTableIds = metadataDao.getOrganizationEligibleTables();\n\n Set<TableOrganizationInfo> tableOrganizationInfo = organizerDao.getNodeTableOrganizationInfo(currentNodeIdentifier);\n Map<Lon... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_638 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestDoubleOperators.java",
"identifier": "TestDoubleOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testMultiply()\n {\n assertFunction(\"37.7E0 * 37.7E0\", DOUBLE, 37.7 * 37.7);\n assertFunction(\"37.7E0 * 17.1E0\", DOUBLE, 37.7 * 17.1);\n assertFunction(\"17.1E0 * 37.7E0\", DOUBLE, 17.1 * 37.7);\n assertFunction(\"17.1E0 * 17.1E0\", DOUBLE, 17.1 * 1... | {
"fields": [
{
"declarator": "MIN_INTEGER_AS_DOUBLE = -0x1p31",
"modifier": "private static final",
"original_string": "private static final double MIN_INTEGER_AS_DOUBLE = -0x1p31;",
"type": "double",
"var_name": "MIN_INTEGER_AS_DOUBLE"
},
{
"declarator": "MAX_INTEGER_... | {
"body": "@ScalarOperator(MULTIPLY)\n @SqlType(StandardTypes.DOUBLE)\n public static double multiply(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right)\n {\n return left * right;\n }",
"class_method_signature": "DoubleOperators.multiply(@SqlType(StandardType... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_116 | {
"fields": [
{
"declarator": "IDENTITY = new HiveIdentity(SESSION)",
"modifier": "private static final",
"original_string": "private static final HiveIdentity IDENTITY = new HiveIdentity(SESSION);",
"type": "HiveIdentity",
"var_name": "IDENTITY"
},
{
"declarator": "TES... | {
"body": "@Test\n public void testGetTableStatistics()\n {\n assertEquals(mockClient.getAccessCount(), 0);\n\n Table table = metastore.getTable(IDENTITY, TEST_DATABASE, TEST_TABLE).get();\n assertEquals(mockClient.getAccessCount(), 1);\n\n assertEquals(metastore.getTableStatistics(I... | {
"fields": [
{
"declarator": "delegate",
"modifier": "protected final",
"original_string": "protected final HiveMetastore delegate;",
"type": "HiveMetastore",
"var_name": "delegate"
},
{
"declarator": "databaseCache",
"modifier": "private final",
"original_... | {
"body": "@Override\n public PartitionStatistics getTableStatistics(HiveIdentity identity, Table table)\n {\n return get(tableStatisticsCache, new WithIdentity<>(updateIdentity(identity), hiveTableName(table.getDatabaseName(), table.getTableName())));\n }",
"class_method_signature": "CachingHiveMet... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_546 | {
"fields": [],
"file": "presto-thrift/src/test/java/io/prestosql/plugin/thrift/TestThriftPlugin.java",
"identifier": "TestThriftPlugin",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlugin()\n {\n Plugin plugin = new ThriftPlugin();\n ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());\n assertInstanceOf(factory, ThriftConnectorFactory.class);\n\n Map<String, String> config = ImmutableMap.of(\"presto.thri... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "module",
"modifier": "private final",
"original_string": "private final Module module... | {
"body": "@Override\n public Iterable<ConnectorFactory> getConnectorFactories()\n {\n return ImmutableList.of(new ThriftConnectorFactory(name, module));\n }",
"class_method_signature": "ThriftPlugin.getConnectorFactories()",
"constructor": false,
"full_signature": "@Override public Iterable<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_815 | {
"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 testCosh()\n {\n for (double doubleValue : DOUBLE_VALUES) {\n assertFunction(\"cosh(\" + doubleValue + \")\", DOUBLE, Math.cosh(doubleValue));\n assertFunction(\"cosh(REAL '\" + (float) doubleValue + \"')\", DOUBLE, Math.cosh((float) doubleValue));\n ... | {
"fields": [
{
"declarator": "DECIMAL_MOD_FUNCTION = decimalModFunction()",
"modifier": "public static final",
"original_string": "public static final SqlScalarFunction DECIMAL_MOD_FUNCTION = decimalModFunction();",
"type": "SqlScalarFunction",
"var_name": "DECIMAL_MOD_FUNCTION"
... | {
"body": "@Description(\"Hyperbolic cosine\")\n @ScalarFunction\n @SqlType(StandardTypes.DOUBLE)\n public static double cosh(@SqlType(StandardTypes.DOUBLE) double num)\n {\n return Math.cosh(num);\n }",
"class_method_signature": "MathFunctions.cosh(@SqlType(StandardTypes.DOUBLE) double 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... |
166515022_60 | {
"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 testDateColumn()\n {\n IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(typeManager);\n List<HiveColumnHandle> columns = ImmutableList.of(\n createBaseColumn(\"t1\", 0, HIVE_TIMESTAMP, TIMESTAMP_MILLIS, REGULAR, Optional.empty()),\n ... | {
"fields": [
{
"declarator": "FORMATTER = date().withChronology(getInstanceUTC())",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter FORMATTER = date().withChronology(getInstanceUTC());",
"type": "DateTimeFormatter",
"var_name": "FORMATT... | {
"body": "public String buildSql(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> tupleDomain)\n {\n columns.forEach(column -> checkArgument(column.isBaseColumn(), \"%s is not a base column\", column));\n tupleDomain.getDomains().ifPresent(domains -> {\n domains.keySet().forE... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_950 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestTransformUncorrelatedInPredicateSubqueryToSemiJoin.java",
"identifier": "TestTransformUncorrelatedInPredicateSubqueryToSemiJoin",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testDoesNotFireOnNonInPredicateSubquery()\n {\n tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToSemiJoin())\n .on(p -> p.apply(\n Assignments.of(p.symbol(\"x\"), new ExistsPredicate(new LongLiteral(\"1\"))),\n ... | {
"fields": [
{
"declarator": "PATTERN = applyNode()\n .with(empty(correlation()))",
"modifier": "private static final",
"original_string": "private static final Pattern<ApplyNode> PATTERN = applyNode()\n .with(empty(correlation()));",
"type": "Pattern<ApplyNode>",
... | {
"body": "@Override\n public Result apply(ApplyNode applyNode, Captures captures, Context context)\n {\n if (applyNode.getSubqueryAssignments().size() != 1) {\n return Result.empty();\n }\n\n Expression expression = getOnlyElement(applyNode.getSubqueryAssignments().getExpression... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_403 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTIntersection()\n {\n assertFunction(\"ST_AsText(ST_Intersection(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)')))\", VARCHAR, \"MULTIPOLYGON EMPTY\");\n assertFunction(\"ST_AsText(ST_Intersection(ST_GeometryFromText('MULTIPOINT (50... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@Description(\"Returns the Geometry value that represents the point set intersection of two Geometries\")\n @ScalarFunction(\"ST_Intersection\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stIntersection(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right)\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1060 | {
"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 testViewWithUppercaseColumn()\n {\n analyze(\"SELECT * FROM v4\");\n }",
"class_method_signature": "TestAnalyzer.testViewWithUppercaseColumn()",
"constructor": false,
"full_signature": "@Test public void testViewWithUppercaseColumn()",
"identifier": "testViewWith... | {
"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_680 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestFunctionType.java",
"identifier": "TestFunctionType",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDisplayName()\n {\n Type function = new FunctionType(\n ImmutableList.of(RowType.from(ImmutableList.of(field(\"field\", DOUBLE)))),\n BIGINT);\n\n assertEquals(function.getDisplayName(), \"function(row(field double),bigint)\");\n ... | {
"fields": [
{
"declarator": "NAME = \"function\"",
"modifier": "public static final",
"original_string": "public static final String NAME = \"function\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "signature",
"modifier": "private final",
"o... | {
"body": "@Override\n public String getDisplayName()\n {\n ImmutableList<String> names = getTypeParameters().stream()\n .map(Type::getDisplayName)\n .collect(toImmutableList());\n return \"function(\" + Joiner.on(\",\").join(names) + \")\";\n }",
"class_method_s... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_395 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTIsRing()\n {\n assertFunction(\"ST_IsRing(ST_GeometryFromText('LINESTRING (8 4, 4 8)'))\", BOOLEAN, false);\n assertFunction(\"ST_IsRing(ST_GeometryFromText('LINESTRING (0 0, 1 1, 0 2, 0 0)'))\", BOOLEAN, true);\n assertInvalidFunction(\"ST_IsRing(ST_Geo... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@SqlNullable\n @Description(\"Returns TRUE if and only if the line is closed and simple\")\n @ScalarFunction(\"ST_IsRing\")\n @SqlType(BOOLEAN)\n public static Boolean stIsRing(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = deserialize(input);\n validate... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1125 | {
"fields": [
{
"declarator": "client",
"modifier": "private",
"original_string": "private HttpClient client;",
"type": "HttpClient",
"var_name": "client"
},
{
"declarator": "server",
"modifier": "private",
"original_string": "private TestingPrestoServer ser... | {
"body": "@Test\n public void testCancel()\n {\n String queryId = startQuery(\"SELECT * FROM tpch.sf100.lineitem\");\n\n server.getAccessControl().deny(privilege(\"query\", KILL_QUERY));\n try {\n assertEquals(cancelQueryInfo(queryId), 403);\n }\n finally {\n ... | {
"fields": [
{
"declarator": "dispatchManager",
"modifier": "private final",
"original_string": "private final DispatchManager dispatchManager;",
"type": "DispatchManager",
"var_name": "dispatchManager"
},
{
"declarator": "accessControl",
"modifier": "private fin... | {
"body": "@ResourceSecurity(AUTHENTICATED_USER)\n @GET\n @Path(\"{queryId}\")\n public Response getQueryInfo(@PathParam(\"queryId\") QueryId queryId, @Context HttpServletRequest servletRequest, @Context HttpHeaders httpHeaders)\n {\n requireNonNull(queryId, \"queryId is null\");\n\n Optiona... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_76 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/glue/TestGlueExpressionUtil.java",
"identifier": "TestGlueExpressionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecimalConverstion()\n {\n TupleDomain<String> filter = new PartitionFilterBuilder()\n .addDecimalValues(\"col1\", \"10.134\")\n .build();\n String expression = buildGlueExpression(ImmutableList.of(\"col1\"), filter, true);\n ... | {
"fields": [
{
"declarator": "NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\"",
"modifier": "static final",
"original_string": "static final String NULL_STRING = \"__HIVE_DEFAULT_PARTITION__\";",
"type": "String",
"var_name": "NULL_STRING"
},
{
"declarator": "GLUE_EXPRESS... | {
"body": "public static String buildGlueExpression(List<String> columnNames, TupleDomain<String> partitionKeysFilter, boolean assumeCanonicalPartitionKeys)\n {\n return buildGlueExpression(columnNames, partitionKeysFilter, assumeCanonicalPartitionKeys, GLUE_EXPRESSION_CHAR_LIMIT);\n }",
"class_method_... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_803 | {
"fields": [
{
"declarator": "ALL_BYTES",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_BYTES;",
"type": "byte[]",
"var_name": "ALL_BYTES"
}
],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestVarbinaryFunctions.ja... | {
"body": "@Test\n public void testMurmur3()\n {\n assertFunction(\"murmur3(CAST('' AS VARBINARY))\", VARBINARY, sqlVarbinaryFromHex(\"00000000000000000000000000000000\"));\n assertFunction(\"murmur3(CAST('hashme' AS VARBINARY))\", VARBINARY, sqlVarbinaryFromHex(\"93192FE805BE23041C8318F67EC4F2BC\... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/operator/scalar/VarbinaryFunctions.java",
"identifier": "VarbinaryFunctions",
"interfaces": "",
"methods": [
{
"class_method_signature": "VarbinaryFunctions.VarbinaryFunctions()",
"constructor": true,
"full_signature": "priv... | {
"body": "@Description(\"Compute murmur3 hash\")\n @ScalarFunction\n @SqlType(StandardTypes.VARBINARY)\n public static Slice murmur3(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n return Murmur3Hash128.hash(slice, 0, slice.length());\n }",
"class_method_signature": "VarbinaryFunctions.m... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_550 | {
"fields": [
{
"declarator": "POSITIONS_PER_PAGE = 0",
"modifier": "private static final",
"original_string": "private static final int POSITIONS_PER_PAGE = 0;",
"type": "int",
"var_name": "POSITIONS_PER_PAGE"
},
{
"declarator": "pagesStore",
"modifier": "private... | {
"body": "@Test(expectedExceptions = PrestoException.class)\n public void testReadFromUnknownTable()\n {\n pagesStore.getPages(0L, 0, 1, ImmutableList.of(0), 0, OptionalLong.empty(), OptionalDouble.empty());\n }",
"class_method_signature": "TestMemoryPagesStore.testReadFromUnknownTable()",
"const... | {
"fields": [
{
"declarator": "maxBytes",
"modifier": "private final",
"original_string": "private final long maxBytes;",
"type": "long",
"var_name": "maxBytes"
},
{
"declarator": "currentBytes",
"modifier": "@GuardedBy(\"this\")\n private",
"original_str... | {
"body": "public synchronized List<Page> getPages(\n Long tableId,\n int partNumber,\n int totalParts,\n List<Integer> columnIndexes,\n long expectedRows,\n OptionalLong limit,\n OptionalDouble sampleRatio)\n {\n if (!contains(tab... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_100 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java",
"identifier": "TestThriftMetastoreAuthenticationConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExplicitPropertyMappings()\n {\n Map<String, String> properties = new ImmutableMap.Builder<String, String>()\n .put(\"hive.metastore.authentication.type\", \"KERBEROS\")\n .build();\n\n ThriftMetastoreAuthenticationConfig expected = ... | {
"fields": [
{
"declarator": "authenticationType = NONE",
"modifier": "private",
"original_string": "private ThriftMetastoreAuthenticationType authenticationType = NONE;",
"type": "ThriftMetastoreAuthenticationType",
"var_name": "authenticationType"
}
],
"file": "presto-hive... | {
"body": "@Config(\"hive.metastore.authentication.type\")\n @ConfigDescription(\"Thrift metastore authentication type\")\n public ThriftMetastoreAuthenticationConfig setAuthenticationType(ThriftMetastoreAuthenticationType authenticationType)\n {\n this.authenticationType = authenticationType;\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_415 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTInteriorRings()\n {\n assertInvalidInteriorRings(\"POINT (2 3)\", \"POINT\");\n assertInvalidInteriorRings(\"LINESTRING EMPTY\", \"LINE_STRING\");\n assertInvalidInteriorRings(\"MULTIPOINT (30 20, 60 70)\", \"MULTI_POINT\");\n assertInvalidInterio... | {
"fields": [
{
"declarator": "OR_JOINER = Joiner.on(\" or \")",
"modifier": "private static final",
"original_string": "private static final Joiner OR_JOINER = Joiner.on(\" or \");",
"type": "Joiner",
"var_name": "OR_JOINER"
},
{
"declarator": "EMPTY_POLYGON = serializ... | {
"body": "@SqlNullable\n @Description(\"Returns an array of interior rings of a polygon\")\n @ScalarFunction(\"ST_InteriorRings\")\n @SqlType(\"array(\" + GEOMETRY_TYPE_NAME + \")\")\n public static Block stInteriorRings(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = des... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_99 | {
"fields": [],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/metastore/thrift/TestThriftMetastoreAuthenticationConfig.java",
"identifier": "TestThriftMetastoreAuthenticationConfig",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaults()\n {\n assertRecordedDefaults(recordDefaults(ThriftMetastoreAuthenticationConfig.class)\n .setAuthenticationType(ThriftMetastoreAuthenticationType.NONE));\n }",
"class_method_signature": "TestThriftMetastoreAuthenticationConfig.testDefaults... | {
"fields": [
{
"declarator": "authenticationType = NONE",
"modifier": "private",
"original_string": "private ThriftMetastoreAuthenticationType authenticationType = NONE;",
"type": "ThriftMetastoreAuthenticationType",
"var_name": "authenticationType"
}
],
"file": "presto-hive... | {
"body": "@Config(\"hive.metastore.authentication.type\")\n @ConfigDescription(\"Thrift metastore authentication type\")\n public ThriftMetastoreAuthenticationConfig setAuthenticationType(ThriftMetastoreAuthenticationType authenticationType)\n {\n this.authenticationType = authenticationType;\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_946 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/iterative/rule/TestRemoveRedundantExists.java",
"identifier": "TestRemoveRedundantExists",
"interfaces": "",
"superclass": "extends BaseRuleTest"
} | {
"body": "@Test\n public void testExistsTrue()\n {\n tester().assertThat(new RemoveRedundantExists())\n .on(p -> p.apply(Assignments.of(p.symbol(\"exists\"), new ExistsPredicate(TRUE_LITERAL)),\n ImmutableList.of(),\n p.values(1),\n ... | {
"fields": [
{
"declarator": "PATTERN = applyNode()\n .matching(node -> node.getSubqueryAssignments()\n .getExpressions().stream()\n .allMatch(expression -> expression instanceof ExistsPredicate && ((ExistsPredicate) expression).getSubquery().equals(TRUE_LIT... | {
"body": "@Override\n public Result apply(ApplyNode node, Captures captures, Context context)\n {\n Assignments.Builder assignments = Assignments.builder();\n assignments.putIdentities(node.getInput().getOutputSymbols());\n\n Expression result;\n if (QueryCardinalityUtil.isEmpty(nod... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_696 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/type/TestRealOperators.java",
"identifier": "TestRealOperators",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testMultiply()\n {\n assertFunction(\"REAL'12.34' * REAL'56.78'\", REAL, 12.34f * 56.78f);\n assertFunction(\"REAL'-17.34' * REAL'-22.891'\", REAL, -17.34f * -22.891f);\n assertFunction(\"REAL'-89.123' * REAL'754.0'\", REAL, -89.123f * 754.0f);\n assert... | {
"fields": [
{
"declarator": "MIN_LONG_AS_FLOAT = -0x1p63f",
"modifier": "private static final",
"original_string": "private static final float MIN_LONG_AS_FLOAT = -0x1p63f;",
"type": "float",
"var_name": "MIN_LONG_AS_FLOAT"
},
{
"declarator": "MAX_LONG_PLUS_ONE_AS_FLO... | {
"body": "@ScalarOperator(MULTIPLY)\n @SqlType(StandardTypes.REAL)\n public static long multiply(@SqlType(StandardTypes.REAL) long left, @SqlType(StandardTypes.REAL) long right)\n {\n return floatToRawIntBits(intBitsToFloat((int) left) * intBitsToFloat((int) right));\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_1076 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/split/TestBufferingSplitSource.java",
"identifier": "TestBufferingSplitSource",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFail()\n {\n MockSplitSource mockSource = new MockSplitSource()\n .setBatchSize(1)\n .increaseAvailableSplits(1)\n .atSplitCompletion(FAIL);\n try (SplitSource source = new BufferingSplitSource(mockSource, 100)) {\n ... | {
"fields": [
{
"declarator": "bufferSize",
"modifier": "private final",
"original_string": "private final int bufferSize;",
"type": "int",
"var_name": "bufferSize"
},
{
"declarator": "source",
"modifier": "private final",
"original_string": "private final S... | {
"body": "@Override\n public ListenableFuture<SplitBatch> getNextBatch(ConnectorPartitionHandle partitionHandle, Lifespan lifespan, int maxSize)\n {\n checkArgument(maxSize > 0, \"Cannot fetch a batch of zero size\");\n return GetNextBatch.fetchNextBatchAsync(source, Math.min(bufferSize, maxSize)... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1133 | {
"fields": [
{
"declarator": "TASK_ID = new TaskId(\"query\", 0, 1)",
"modifier": "private static final",
"original_string": "private static final TaskId TASK_ID = new TaskId(\"query\", 0, 1);",
"type": "TaskId",
"var_name": "TASK_ID"
},
{
"declarator": "OUT = new Outp... | {
"body": "@Test\n public void testRemoveOldTasks()\n throws Exception\n {\n try (SqlTaskManager sqlTaskManager = createSqlTaskManager(new TaskManagerConfig().setInfoMaxAge(new Duration(5, TimeUnit.MILLISECONDS)))) {\n TaskId taskId = TASK_ID;\n\n TaskInfo taskInfo = crea... | {
"fields": [
{
"declarator": "log = Logger.get(SqlTaskManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.get(SqlTaskManager.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "taskNotification... | {
"body": "public void removeOldTasks()\n {\n DateTime oldestAllowedTask = DateTime.now().minus(infoCacheTime.toMillis());\n tasks.asMap().values().stream()\n .map(SqlTask::getTaskInfo)\n .filter(Objects::nonNull)\n .forEach(taskInfo -> {\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_1099 | {
"fields": [
{
"declarator": "BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(BOOLEAN))",
"modifier": "private static final",
"original_string": "private static final Function<String, Column> BOOLEAN_COLUMN = name -> new Column(name, BOOLEAN, new ClientTypeSignature(B... | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"columns and types must be present at the same time\")\n public void shouldThrowWhenTypesAreNull()\n {\n List<Column> columns = ImmutableList.of(INT_COLUMN.apply(\"_col0\"));\n List<Type> types... | {
"fields": [
{
"declarator": "session",
"modifier": "private final",
"original_string": "private final ConnectorSession session;",
"type": "ConnectorSession",
"var_name": "session"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string"... | {
"body": "public static Builder queryResultRowsBuilder(Session session)\n {\n return new Builder(session);\n }",
"class_method_signature": "QueryResultRows.queryResultRowsBuilder(Session session)",
"constructor": false,
"full_signature": "public static Builder queryResultRowsBuilder(Session sessio... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_229 | {
"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 testAbortOldTransactions()\n {\n TestingDao dao = dbi.onDemand(TestingDao.class);\n\n long now = System.currentTimeMillis();\n\n long txn1 = dao.insertTransaction(new Timestamp(now - HOURS.toMillis(26)));\n long txn2 = dao.insertTransaction(new Timestam... | {
"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 abortOldTransactions()\n {\n dao.abortOldTransactions(maxTimestamp(maxTransactionAge));\n }",
"class_method_signature": "ShardCleaner.abortOldTransactions()",
"constructor": false,
"full_signature": "@VisibleForTesting void abortOldTransactions()",
"identif... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_383 | {
"fields": [],
"file": "presto-geospatial/src/test/java/io/prestosql/plugin/geospatial/TestGeoFunctions.java",
"identifier": "TestGeoFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testSTConvexHull()\n {\n // test empty geometry\n assertConvexHull(\"POINT EMPTY\", \"POINT EMPTY\");\n assertConvexHull(\"MULTIPOINT EMPTY\", \"MULTIPOINT EMPTY\");\n assertConvexHull(\"LINESTRING EMPTY\", \"LINESTRING EMPTY\");\n assertConvexHu... | {
"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 minimum convex geometry that encloses all input geometries\")\n @ScalarFunction(\"ST_ConvexHull\")\n @SqlType(GEOMETRY_TYPE_NAME)\n public static Slice stConvexHull(@SqlType(GEOMETRY_TYPE_NAME) Slice input)\n {\n OGCGeometry geometry = deserialize(input);\n ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_679 | {
"fields": [
{
"declarator": "metadata = createTestMetadataManager()",
"modifier": "private final",
"original_string": "private final Metadata metadata = createTestMetadataManager();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "re2jType = metadata.g... | {
"body": "@Test\n public void testCastOperatorsExistForCoercions()\n {\n Set<Type> types = getStandardPrimitiveTypes();\n for (Type sourceType : types) {\n for (Type resultType : types) {\n if (typeCoercion.canCoerce(sourceType, resultType) && sourceType != UNKNOWN && re... | {
"fields": [
{
"declarator": "lookupType",
"modifier": "private final",
"original_string": "private final Function<TypeSignature, Type> lookupType;",
"type": "Function<TypeSignature, Type>",
"var_name": "lookupType"
}
],
"file": "presto-main/src/main/java/io/prestosql/type/T... | {
"body": "public boolean canCoerce(Type fromType, Type toType)\n {\n TypeCompatibility typeCompatibility = compatibility(fromType, toType);\n return typeCompatibility.isCoercible();\n }",
"class_method_signature": "TypeCoercion.canCoerce(Type fromType, Type toType)",
"constructor": false,
"... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_157 | {
"fields": [
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestThrottledAsyncQueue.java",
"i... | {
"body": "@Test(timeOut = 10_000)\n public void testBorrowThrows()\n throws Exception\n {\n // It doesn't matter the exact behavior when the caller-supplied function to borrow fails.\n // However, it must not block pending futures.\n\n AsyncQueue<Integer> queue = new ThrottledAs... | {
"fields": [
{
"declarator": "maxBatchSizePerSec",
"modifier": "private final",
"original_string": "private final int maxBatchSizePerSec;",
"type": "int",
"var_name": "maxBatchSizePerSec"
},
{
"declarator": "executor",
"modifier": "private final",
"original... | {
"body": "@Override\n public synchronized <O> ListenableFuture<O> borrowBatchAsync(int maxSize, Function<List<T>, BorrowResult<T, O>> function)\n {\n checkArgument(maxSize >= 0, \"maxSize must be at least 0\");\n\n ListenableFuture<?> throttleFuture = immediateFuture(null);\n if (size() > ... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_507 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/block/TestLazyBlock.java",
"identifier": "TestLazyBlock",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNestedListener()\n {\n List<Block> actualNotifications = new ArrayList<>();\n LazyBlock lazyBlock = new LazyBlock(1, TestLazyBlock::createInfiniteRecursiveRowBlock);\n LazyBlock.listenForLoads(lazyBlock, actualNotifications::add);\n\n List<Block> ex... | {
"fields": [
{
"declarator": "INSTANCE_SIZE = ClassLayout.parseClass(LazyBlock.class).instanceSize() + ClassLayout.parseClass(LazyData.class).instanceSize()",
"modifier": "private static final",
"original_string": "private static final int INSTANCE_SIZE = ClassLayout.parseClass(LazyBlock.class)... | {
"body": "public static void listenForLoads(Block block, Consumer<Block> listener)\n {\n requireNonNull(block, \"block is null\");\n requireNonNull(listener, \"listener is null\");\n\n LazyData.addListenersRecursive(block, singletonList(listener));\n }",
"class_method_signature": "LazyBl... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_21 | {
"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 testSchemaRulesForCheckCanSetSchemaAuthorization()\n {\n SystemAccessControl accessControl = newFileBasedSystemAccessControl(\"file-based-system-access-schema.json\");\n\n accessControl.checkCanSetSchemaAuthorization(ADMIN, new CatalogSchemaName(\"some-catalog\", \"t... | {
"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_854 | {
"fields": [
{
"declarator": "TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY",
"modifier": "protected static final",
"original_string": "protected static final TimeZoneKey TIME_ZONE_KEY = TestingSession.DEFAULT_TIME_ZONE_KEY;",
"type": "TimeZoneKey",
"var_name": "TIME_ZONE_KEY... | {
"body": "@Test\n public void testParseDuration()\n {\n assertFunction(\"parse_duration('1234 ns')\", INTERVAL_DAY_TIME, new SqlIntervalDayTime(0, 0, 0, 0, 0));\n assertFunction(\"parse_duration('1234 us')\", INTERVAL_DAY_TIME, new SqlIntervalDayTime(0, 0, 0, 0, 1));\n assertFunction(\"par... | {
"fields": [
{
"declarator": "DATETIME_FORMATTER_CACHE =\n new ThreadLocalCache<>(100, DateTimeFunctions::createDateTimeFormatter)",
"modifier": "private static final",
"original_string": "private static final ThreadLocalCache<Slice, DateTimeFormatter> DATETIME_FORMATTER_CACHE =\n ... | {
"body": "@Description(\"Convert duration string to an interval\")\n @ScalarFunction(\"parse_duration\")\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.INTERVAL_DAY_TO_SECOND)\n public static long parseDuration(@SqlType(\"varchar(x)\") Slice duration)\n {\n try {\n return Durat... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_911 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/sql/planner/optimizations/TestLocalProperties.java",
"identifier": "TestLocalProperties",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstantWithMultiGroup()\n {\n List<LocalProperty<String>> actual = builder()\n .constant(\"a\")\n .grouped(\"a\", \"b\")\n .grouped(\"a\", \"c\")\n .build();\n\n assertMatch(\n actual,\n ... | {
"fields": [],
"file": "presto-main/src/main/java/io/prestosql/sql/planner/optimizations/LocalProperties.java",
"identifier": "LocalProperties",
"interfaces": "",
"methods": [
{
"class_method_signature": "LocalProperties.LocalProperties()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static <T> List<LocalProperty<T>> grouped(Collection<T> columns)\n {\n return ImmutableList.of(new GroupingProperty<>(columns));\n }",
"class_method_signature": "LocalProperties.grouped(Collection<T> columns)",
"constructor": false,
"full_signature": "public static List<LocalPrope... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_442 | {
"fields": [],
"file": "presto-spi/src/test/java/io/prestosql/spi/type/TestDecimals.java",
"identifier": "TestDecimals",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncodeScaledValue()\n {\n assertEquals(encodeScaledValue(new BigDecimal(\"2.00\"), 2), sliceFromBytes(200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));\n assertEquals(encodeScaledValue(new BigDecimal(\"2.13\"), 2), sliceFromBytes(213, 0, 0, 0, 0, 0, 0, 0, 0, 0,... | {
"fields": [
{
"declarator": "MAX_PRECISION = 38",
"modifier": "public static final",
"original_string": "public static final int MAX_PRECISION = 38;",
"type": "int",
"var_name": "MAX_PRECISION"
},
{
"declarator": "MAX_SHORT_PRECISION = 18",
"modifier": "public s... | {
"body": "public static Slice encodeScaledValue(BigDecimal value, int scale)\n {\n return encodeScaledValue(value, scale, UNNECESSARY);\n }",
"class_method_signature": "Decimals.encodeScaledValue(BigDecimal value, int scale)",
"constructor": false,
"full_signature": "public static Slice encodeScal... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_1021 | {
"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 testOrderByExpressionOnOutputColumn()\n {\n // TODO: analyze output\n analyze(\"SELECT a x FROM t1 ORDER BY x + 1\");\n analyze(\"SELECT max(a) FROM (values (1,2), (2,1)) t(a,b) GROUP BY b ORDER BY max(b*1e0)\");\n analyze(\"SELECT CAST(ROW(1) AS ROW(so... | {
"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_291 | {
"fields": [],
"file": "presto-thrift-api/src/test/java/io/prestosql/plugin/thrift/api/valuesets/TestPrestoThriftAllOrNoneValueSet.java",
"identifier": "TestPrestoThriftAllOrNoneValueSet",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFromValueSetAll()\n {\n PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.all(HYPER_LOG_LOG));\n assertNotNull(thriftValueSet.getAllOrNoneValueSet());\n assertTrue(thriftValueSet.getAllOrNoneValueSet().isAll());\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "all",
"modifier": "private final",
"original_string": "private final boolean all;",
"type": "boolean",
"var_name": "all"
}
],
"file": "presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/valuesets/PrestoThriftAllOrNoneValueSet.java",
... | {
"body": "@ThriftField(1)\n public boolean isAll()\n {\n return all;\n }",
"class_method_signature": "PrestoThriftAllOrNoneValueSet.isAll()",
"constructor": false,
"full_signature": "@ThriftField(1) public boolean isAll()",
"identifier": "isAll",
"invocations": [],
"modifiers": "@ThriftFi... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
166515022_784 | {
"fields": [],
"file": "presto-main/src/test/java/io/prestosql/operator/scalar/TestBitwiseFunctions.java",
"identifier": "TestBitwiseFunctions",
"interfaces": "",
"superclass": "extends AbstractTestFunctions"
} | {
"body": "@Test\n public void testBitwiseAnd()\n {\n assertFunction(\"bitwise_and(0, -1)\", BIGINT, 0L);\n assertFunction(\"bitwise_and(3, 8)\", BIGINT, 3L & 8L);\n assertFunction(\"bitwise_and(-4, 12)\", BIGINT, -4L & 12L);\n assertFunction(\"bitwise_and(60, 21)\", BIGINT, 60L & 21... | {
"fields": [
{
"declarator": "TINYINT_MASK = 0b1111_1111L",
"modifier": "private static final",
"original_string": "private static final long TINYINT_MASK = 0b1111_1111L;",
"type": "long",
"var_name": "TINYINT_MASK"
},
{
"declarator": "TINYINT_SIGNED_BIT = 0b1000_0000L... | {
"body": "@Description(\"Bitwise AND in 2's complement arithmetic\")\n @ScalarFunction\n @SqlType(StandardTypes.BIGINT)\n public static long bitwiseAnd(@SqlType(StandardTypes.BIGINT) long left, @SqlType(StandardTypes.BIGINT) long right)\n {\n return left & right;\n }",
"class_method_signature... | {
"created": "1/19/2019 6:38:14 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 166515022,
"size": null,
"stargazer_count": null,
"stars": 849,
"updates": "2020-01-27T22:04:31+00:00",
"url": "https://github.com/prestosql/prest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.