File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
exec/java-exec/src/main/java/org/apache/drill/exec Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff 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 () {
Original file line number Diff line number Diff line change 1919
2020import org .apache .commons .lang3 .StringUtils ;
2121import 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 ;
2225import org .apache .drill .exec .oauth .PersistentTokenRegistry ;
2326import org .apache .drill .exec .oauth .TokenRegistry ;
2427import 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 ) {
Original file line number Diff line number Diff line change 2121
2222import com .fasterxml .jackson .annotation .JacksonInject ;
2323import com .fasterxml .jackson .annotation .JsonCreator ;
24-
2524import com .fasterxml .jackson .annotation .JsonIgnore ;
2625import com .fasterxml .jackson .annotation .JsonProperty ;
27- import org .apache .drill .exec .oauth .PersistentTokenRegistry ;
28- import org .apache .drill .exec .oauth .Tokens ;
2926import org .apache .drill .exec .record .metadata .TupleMetadata ;
3027import org .apache .drill .exec .store .sys .PersistentStore ;
3128
3734 */
3835public 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 }
You can’t perform that action at this time.
0 commit comments