Skip to content

Commit a9fd902

Browse files
committed
WIP
1 parent e9ca07e commit a9fd902

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ public SchemaPlus getRootSchema(SchemaConfig schemaConfig) {
214214
}
215215

216216
/**
217-
* Get the user name of the user who issued the query that is managed by this QueryContext.
218-
* @return The user name of the user who issued the query that is managed by this QueryContext.
217+
* Get the username of the user who issued the query that is managed by this QueryContext.
218+
* @return The username of the user who issued the query that is managed by this QueryContext.
219219
*/
220220
@Override
221221
public String getQueryUserName() {

exec/java-exec/src/main/java/org/apache/drill/exec/schema/daffodil/DaffodilSchemaProvider.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
import org.apache.commons.lang3.StringUtils;
2121
import org.apache.drill.common.AutoCloseables;
22+
import org.apache.drill.common.config.DrillConfig;
23+
import org.apache.drill.common.scanner.ClassPathScanner;
24+
import org.apache.drill.common.scanner.persistence.ScanResult;
2225
import org.apache.drill.exec.oauth.PersistentTokenRegistry;
2326
import org.apache.drill.exec.oauth.TokenRegistry;
2427
import org.apache.drill.exec.server.DrillbitContext;
@@ -34,7 +37,15 @@ public class DaffodilSchemaProvider implements AutoCloseable {
3437
private PersistentTokenRegistry daffodilSchemaRegistry;
3538

3639
public DaffodilSchemaProvider(DrillbitContext context) {
37-
this.context = context;
40+
this(context.getConfig(), ClassPathScanner.fromPrescan(context.getConfig()));
41+
}
42+
43+
public DaffodilSchemaProvider(DrillConfig config, ScanResult classpathScan) {
44+
this(config, classpathScan, null);
45+
}
46+
47+
public DaffodilSchemaProvider(DrillConfig config, ScanResult classpathScan, String username) {
48+
3849
}
3950

4051
public TokenRegistry getDaffodilSchemaRegistry(String username) {

exec/java-exec/src/main/java/org/apache/drill/exec/schema/daffodil/PersistentSchemaTable.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@
2121

2222
import com.fasterxml.jackson.annotation.JacksonInject;
2323
import com.fasterxml.jackson.annotation.JsonCreator;
24-
2524
import com.fasterxml.jackson.annotation.JsonIgnore;
2625
import com.fasterxml.jackson.annotation.JsonProperty;
27-
import org.apache.drill.exec.oauth.PersistentTokenRegistry;
28-
import org.apache.drill.exec.oauth.Tokens;
2926
import org.apache.drill.exec.record.metadata.TupleMetadata;
3027
import org.apache.drill.exec.store.sys.PersistentStore;
3128

@@ -37,11 +34,8 @@
3734
*/
3835
public class PersistentSchemaTable implements DaffodilSchemata {
3936
public final String SCHEMA_KEY = "schema";
40-
4137
private final Map<String, TupleMetadata> schemata;
42-
4338
private final String key;
44-
4539
private final PersistentStore<org.apache.drill.exec.schema.daffodil.PersistentSchemaTable> store;
4640

4741
@JsonCreator
@@ -80,7 +74,7 @@ public TupleMetadata get(String schemaName) {
8074
@JsonIgnore
8175
public boolean put(String token, String value, boolean replace) {
8276
if (replace || ! schemata.containsKey(token)) {
83-
schemata.put(token, value);
77+
schemata.put(token, TupleMetadata.of(value));
8478
store.put(key, this);
8579
return true;
8680
}

0 commit comments

Comments
 (0)