Codota Logo
SchemaTableName.<init>
Code IndexAdd Codota to your IDE (free)

How to use
io.prestosql.spi.connector.SchemaTableName
constructor

Best Java code snippets using io.prestosql.spi.connector.SchemaTableName.<init> (Showing top 20 results out of 360)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: io.prestosql/presto-base-jdbc

protected SchemaTableName getSchemaTableName(ResultSet resultSet)
    throws SQLException
{
  return new SchemaTableName(
      resultSet.getString("TABLE_SCHEM").toLowerCase(ENGLISH),
      resultSet.getString("TABLE_NAME").toLowerCase(ENGLISH));
}
origin: io.prestosql/presto-main

public void addProcedures(ConnectorId connectorId, Collection<Procedure> procedures)
{
  requireNonNull(connectorId, "connectorId is null");
  requireNonNull(procedures, "procedures is null");
  procedures.forEach(this::validateProcedure);
  Map<SchemaTableName, Procedure> proceduresByName = Maps.uniqueIndex(
      procedures,
      procedure -> new SchemaTableName(procedure.getSchema(), procedure.getName()));
  checkState(connectorProcedures.putIfAbsent(connectorId, proceduresByName) == null, "Procedures already registered for connector: %s", connectorId);
}
origin: io.prestosql/presto-tpcds

@Override
public List<SchemaTableName> listTables(ConnectorSession session, Optional<String> filterSchema)
{
  ImmutableList.Builder<SchemaTableName> builder = ImmutableList.builder();
  for (String schemaName : getSchemaNames(session, filterSchema)) {
    for (Table tpcdsTable : Table.getBaseTables()) {
      builder.add(new SchemaTableName(schemaName, tpcdsTable.getName()));
    }
  }
  return builder.build();
}
origin: io.prestosql/presto-tpch

@Override
public List<SchemaTableName> listTables(ConnectorSession session, Optional<String> filterSchema)
{
  ImmutableList.Builder<SchemaTableName> builder = ImmutableList.builder();
  for (String schemaName : getSchemaNames(session, filterSchema)) {
    for (TpchTable<?> tpchTable : TpchTable.getTables()) {
      builder.add(new SchemaTableName(schemaName, tpchTable.getTableName()));
    }
  }
  return builder.build();
}
origin: io.prestosql/presto-hive

@Override
public synchronized Optional<Table> getTable(String databaseName, String tableName)
{
  SchemaTableName schemaTableName = new SchemaTableName(databaseName, tableName);
  return Optional.ofNullable(relations.get(schemaTableName));
}
origin: io.prestosql/presto-hive

protected static SchemaTableName temporaryTable(String database, String tableName)
{
  String randomName = UUID.randomUUID().toString().toLowerCase(ENGLISH).replace("-", "");
  return new SchemaTableName(database, TEMPORARY_TABLE_PREFIX + tableName + "_" + randomName);
}
origin: io.prestosql/presto-base-jdbc

@Test
public void testJsonRoundTrip()
{
  assertJsonRoundTrip(TABLE_CODEC, new JdbcTableHandle("connectorId", new SchemaTableName("schema", "table"), "jdbcCatalog", "jdbcSchema", "jdbcTable"));
}
origin: io.prestosql/presto-base-jdbc

@Test
public void testGetTableHandle()
{
  JdbcTableHandle tableHandle = metadata.getTableHandle(SESSION, new SchemaTableName("example", "numbers"));
  assertEquals(metadata.getTableHandle(SESSION, new SchemaTableName("example", "numbers")), tableHandle);
  assertNull(metadata.getTableHandle(SESSION, new SchemaTableName("example", "unknown")));
  assertNull(metadata.getTableHandle(SESSION, new SchemaTableName("unknown", "numbers")));
  assertNull(metadata.getTableHandle(SESSION, new SchemaTableName("unknown", "unknown")));
}
origin: io.prestosql/presto-main

@Test
public void testSystemDeserialize()
    throws Exception
{
  String json = objectMapper.writeValueAsString(SCHEMA_AS_MAP);
  ConnectorTableHandle tableHandle = objectMapper.readValue(json, ConnectorTableHandle.class);
  assertEquals(tableHandle.getClass(), SystemTableHandle.class);
  SystemTableHandle systemHandle = (SystemTableHandle) tableHandle;
  assertEquals(systemHandle.getConnectorId(), CONNECTOR_ID);
  assertEquals(systemHandle.getSchemaTableName(), new SchemaTableName("system_schema", "system_table"));
}
origin: io.prestosql/presto-base-jdbc

@Override
public void rollbackCreateTable(JdbcOutputTableHandle handle)
{
  dropTable(new JdbcTableHandle(
      handle.getConnectorId(),
      new SchemaTableName(handle.getSchemaName(), handle.getTemporaryTableName()),
      handle.getCatalogName(),
      handle.getSchemaName(),
      handle.getTemporaryTableName()));
}
origin: io.prestosql/presto-hive

@Override
public synchronized PartitionStatistics getTableStatistics(String databaseName, String tableName)
{
  SchemaTableName schemaTableName = new SchemaTableName(databaseName, tableName);
  PartitionStatistics statistics = columnStatistics.get(schemaTableName);
  if (statistics == null) {
    statistics = new PartitionStatistics(createEmptyStatistics(), ImmutableMap.of());
  }
  return statistics;
}
origin: io.prestosql/presto-base-jdbc

@Test(expectedExceptions = PrestoException.class)
public void testCreateTable()
{
  metadata.createTable(
      SESSION,
      new ConnectorTableMetadata(
          new SchemaTableName("example", "foo"),
          ImmutableList.of(new ColumnMetadata("text", VARCHAR))),
      false);
}
origin: io.prestosql/presto-base-jdbc

@Test
public void testMetadataWithSchemaPattern()
{
  SchemaTableName schemaTableName = new SchemaTableName("exa_ple", "num_ers");
  JdbcTableHandle table = jdbcClient.getTableHandle(schemaTableName);
  assertNotNull(table, "table is null");
  assertEquals(jdbcClient.getColumns(session, table), ImmutableList.of(
      new JdbcColumnHandle(CONNECTOR_ID, "TE_T", JDBC_VARCHAR, VARCHAR),
      new JdbcColumnHandle(CONNECTOR_ID, "VA%UE", JDBC_BIGINT, BIGINT)));
}
origin: io.prestosql/presto-hive

public void updateTableLocation(String databaseName, String tableName, String location)
{
  Optional<Table> table = getTable(databaseName, tableName);
  if (!table.isPresent()) {
    throw new TableNotFoundException(new SchemaTableName(databaseName, tableName));
  }
  Table.Builder tableBuilder = Table.builder(table.get());
  tableBuilder.getStorageBuilder().setLocation(location);
  // NOTE: this clears the permissions
  replaceTable(databaseName, tableName, tableBuilder.build(), new PrincipalPrivileges(ImmutableMultimap.of(), ImmutableMultimap.of()));
}
origin: io.prestosql/presto-main

protected AbstractPropertiesSystemTable(String tableName, TransactionManager transactionManager, Supplier<Map<ConnectorId, Map<String, PropertyMetadata<?>>>> propertySupplier)
{
  this.tableMetadata = tableMetadataBuilder(new SchemaTableName("metadata", tableName))
      .column("catalog_name", createUnboundedVarcharType())
      .column("property_name", createUnboundedVarcharType())
      .column("default_value", createUnboundedVarcharType())
      .column("type", createUnboundedVarcharType())
      .column("description", createUnboundedVarcharType())
      .build();
  this.transactionManager = requireNonNull(transactionManager, "transactionManager is null");
  this.propertySupplier = requireNonNull(propertySupplier, "propertySupplier is null");
}
origin: io.prestosql/presto-base-jdbc

@BeforeMethod
public void setUp()
    throws Exception
{
  database = new TestingDatabase();
  metadata = new JdbcMetadata(database.getJdbcClient(), false);
  tableHandle = metadata.getTableHandle(SESSION, new SchemaTableName("example", "numbers"));
}
origin: io.prestosql/presto-tpch

private void testNoTableStats(String schema, TpchTable<?> table)
{
  TpchTableHandle tableHandle = tpchMetadata.getTableHandle(session, new SchemaTableName(schema, table.getTableName()));
  TableStatistics tableStatistics = tpchMetadata.getTableStatistics(session, tableHandle, alwaysTrue());
  assertTrue(tableStatistics.getRowCount().isUnknown());
}
origin: io.prestosql/presto-main

  @Test
  public void test()
  {
    tester().assertThat(new RemoveEmptyDelete())
        .on(p -> p.tableDelete(
            new SchemaTableName("sch", "tab"),
            p.values(),
            p.symbol("a", BigintType.BIGINT)))
        .matches(
            PlanMatchPattern.values(ImmutableMap.of("a", 0)));
  }
}
origin: io.prestosql/presto-base-jdbc

public JdbcSplit getSplit(String schemaName, String tableName)
{
  JdbcTableHandle jdbcTableHandle = jdbcClient.getTableHandle(new SchemaTableName(schemaName, tableName));
  JdbcTableLayoutHandle jdbcLayoutHandle = new JdbcTableLayoutHandle(jdbcTableHandle, TupleDomain.all());
  ConnectorSplitSource splits = jdbcClient.getSplits(jdbcLayoutHandle);
  return (JdbcSplit) getOnlyElement(getFutureValue(splits.getNextBatch(NOT_PARTITIONED, 1000)).getSplits());
}
origin: io.prestosql/presto-tpch

private void testColumnStats(String schema, TpchTable<?> table, TpchColumn<?> column, Constraint<ColumnHandle> constraint, ColumnStatistics expected)
{
  TpchTableHandle tableHandle = tpchMetadata.getTableHandle(session, new SchemaTableName(schema, table.getTableName()));
  TableStatistics tableStatistics = tpchMetadata.getTableStatistics(session, tableHandle, constraint);
  ColumnHandle columnHandle = tpchMetadata.getColumnHandles(session, tableHandle).get(column.getSimplifiedColumnName());
  ColumnStatistics actual = tableStatistics.getColumnStatistics().get(columnHandle);
  EstimateAssertion estimateAssertion = new EstimateAssertion(TOLERANCE);
  estimateAssertion.assertClose(actual.getDistinctValuesCount(), expected.getDistinctValuesCount(), "distinctValuesCount");
  estimateAssertion.assertClose(actual.getDataSize(), expected.getDataSize(), "dataSize");
  estimateAssertion.assertClose(actual.getNullsFraction(), expected.getNullsFraction(), "nullsFraction");
  estimateAssertion.assertClose(actual.getRange(), expected.getRange(), "range");
}
io.prestosql.spi.connectorSchemaTableName<init>

Popular methods of SchemaTableName

  • getTableName
  • getSchemaName
  • toString
  • toSchemaTablePrefix
  • equals

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
  • putExtra (Intent)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now