use of org.eclipse.xtext.testlanguages.actionLang3.Entry in project beam by apache.
the class DataCatalogTableProvider method setSchemaIfNotPresent.
@Internal
public boolean setSchemaIfNotPresent(String resource, Schema schema) {
com.google.cloud.datacatalog.v1beta1.Schema dcSchema = SchemaUtils.toDataCatalog(schema);
Entry entry = dataCatalog.lookupEntry(LookupEntryRequest.newBuilder().setSqlResource(resource).build());
if (entry.getSchema().getColumnsCount() == 0) {
dataCatalog.updateEntry(UpdateEntryRequest.newBuilder().setEntry(entry.toBuilder().setSchema(dcSchema).build()).setUpdateMask(FieldMask.newBuilder().addPaths("schema").build()).build());
return true;
} else {
LOG.info(String.format("Not updating schema for '%s' since it already has one.", resource));
return false;
}
}
use of org.eclipse.xtext.testlanguages.actionLang3.Entry in project xtext-core by eclipse.
the class ActionTestLanguage3SemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == ActionLang3Package.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case ActionLang3Package.ENTRY:
sequence_ProductionRule2(context, (Entry) semanticObject);
return;
case ActionLang3Package.P1:
sequence_ProductionRule1_P2_2(context, (P1) semanticObject);
return;
case ActionLang3Package.P2:
sequence_ProductionRule1_P3_4(context, (P2) semanticObject);
return;
case ActionLang3Package.P3:
sequence_ProductionRule1(context, (P3) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Aggregations