Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #169]: add session properties about layout-path enabling to pixels-presto. #171

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ log.dir=/home/ubuntu/opt/pixels/listener/
`log-dir` should point to
an existing directory where the listener logs will appear

* Create the catalog config file named `pixels-presto.properties` for Pixels in the `catalog` subdirectory,
* Create the catalog config file named `pixels.properties` for Pixels in the `catalog` subdirectory,
with the following content:
```properties
connector.name=pixels-presto
connector.name=pixels
pixels.home=/home/ubuntu/opt/pixels/
```
`pixels.home` should be the same as `PIXELS_HOME`.
**Note** that this `pixels.properties` is in the `etc/catalog` directory of Presto's home, and is different from `PIXELS_HOME/pixels.properties`.

Some scripts in Presto may also require python:
```bash
Expand Down Expand Up @@ -236,7 +237,7 @@ Enter the home of presto-server and start Presto:

Connect to presto-server using presto-cli:
```bash
./bin/presto --server localhost:8080 --catalog pixels-presto
./bin/presto --server localhost:8080 --catalog pixels
```
Run `SHOW SCHEMAS` in presto-cli, the result should be as follows if everything is installed correctly.
```sql
Expand Down Expand Up @@ -300,7 +301,7 @@ This may take a few hours.
Connect to presto-cli:
```bash
cd ~/opt/presto-server
./bin/presto --server localhost:8080 --catalog pixels-presto --schema tpch
./bin/presto --server localhost:8080 --catalog pixels --schema tpch
```
Execute the TPC-H queries in presto-cli.

Expand Down
2 changes: 1 addition & 1 deletion pixels-common/src/main/resources/pixels.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ compression.block.size=1
row.batch.size=10000

# Presto configuration (pixels)
presto.pixels.jdbc.url=jdbc:presto://localhost:8080/pixels-presto/pixels
presto.pixels.jdbc.url=jdbc:presto://localhost:8080/pixels/pixels
presto.orc.jdbc.url=jdbc:presto://localhost:8080/hive/default
presto.user=test_pixels
presto.password=null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Copyright 2022 PixelsDB.
*
* This file is part of Pixels.
*
* Pixels is free software: you can redistribute it and/or modify
* it under the terms of the Affero GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Pixels is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Affero GNU General Public License for more details.
*
* You should have received a copy of the Affero GNU General Public
* License along with Pixels. If not, see
* <https://www.gnu.org/licenses/>.
*/
package io.pixelsdb.pixels.common;

import io.pixelsdb.pixels.common.physical.Storage;
Expand Down
2 changes: 1 addition & 1 deletion pixels-load/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Use `LOAD -h`, you can see the usages of the command
Create table in presto:
```
cd /home/iir/opt/presto-server-0.192
./bin/presto --server localhost:8080 --catalog pixels-presto --schema pixels
./bin/presto --server localhost:8080 --catalog pixels --schema pixels
create table ...;
```

Expand Down
5 changes: 3 additions & 2 deletions pixels-presto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@


## Installation
Copy `pixels-presto.properties` to the catalog directory of Presto
Copy the `pixels.properties` under `pixels-presto/src/main/resources`
to the `etc/catalog` directory of Presto's home.
Build Pixels by `mvn package`, copy and unzip `pixels-presto-0.1.0-SNAPSHOT.zip`
to the plugin directory of Presto

Expand Down Expand Up @@ -32,7 +33,7 @@ Run the presto client, we should do the following things:
```
- execute
```sh
./bin/presto --server localhost:8080 --catalog pixels-presto --schema pixels
./bin/presto --server localhost:8080 --catalog pixels --schema pixels

select * from test;
select count(*) from test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.log.Logger;
import io.pixelsdb.pixels.presto.exception.PixelsErrorCode;
import io.pixelsdb.pixels.presto.properties.PixelsSessionProperties;
import io.pixelsdb.pixels.presto.properties.PixelsTableProperties;

import javax.inject.Inject;

import java.util.List;

import static java.util.Objects.requireNonNull;
Expand All @@ -44,6 +45,7 @@ public class PixelsConnector
private final PixelsMetadata metadata;
private final PixelsSplitManager splitManager;
private final PixelsPageSourceProvider pageSourceProvider;
private final PixelsSessionProperties sessionProperties;
private final PixelsTableProperties tableProperties;

@Inject
Expand All @@ -52,11 +54,13 @@ public PixelsConnector(
PixelsMetadata metadata,
PixelsSplitManager splitManager,
PixelsPageSourceProvider pageSourceProvider,
PixelsSessionProperties sessionProperties,
PixelsTableProperties tableProperties) {
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.metadata = requireNonNull(metadata, "metadata is null");
this.splitManager = requireNonNull(splitManager, "splitManager is null");
this.pageSourceProvider = requireNonNull(pageSourceProvider, "recordSetProvider is null");
this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null");
this.tableProperties = requireNonNull(tableProperties, "tableProperties is null");
}

Expand Down Expand Up @@ -90,6 +94,12 @@ public final void shutdown() {
}
}

@Override
public List<PropertyMetadata<?>> getSessionProperties()
{
return sessionProperties.getSessionProperties();
}

@Override
public List<PropertyMetadata<?>> getTableProperties()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class PixelsConnectorFactory

private Logger logger = Logger.get(PixelsConnectorFactory.class);

private final String name = "pixels-presto";
private final String name = "pixels";

public PixelsConnectorFactory() {
logger.debug("Connector " + name + " initialized.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import com.google.inject.Scopes;
import io.pixelsdb.pixels.presto.impl.PixelsMetadataProxy;
import io.pixelsdb.pixels.presto.impl.PixelsPrestoConfig;
import io.pixelsdb.pixels.presto.properties.PixelsSessionProperties;
import io.pixelsdb.pixels.presto.properties.PixelsTableProperties;

import javax.inject.Inject;

Expand Down Expand Up @@ -57,6 +59,7 @@ public void configure(Binder binder)
binder.bind(PixelsMetadataProxy.class).in(Scopes.SINGLETON);
binder.bind(PixelsSplitManager.class).in(Scopes.SINGLETON);
binder.bind(PixelsPageSourceProvider.class).in(Scopes.SINGLETON);
binder.bind(PixelsSessionProperties.class).in(Scopes.SINGLETON);
binder.bind(PixelsTableProperties.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(PixelsPrestoConfig.class);

Expand Down
Loading