Creates an {@link Type#ARRAY ARRAY} {@link Schema} of the given component type.
@param componentSchema Schema of the array component.
@return A {@link Schema} of {@link Type#ARRAY ARRAY} type.
963864
public static Schema arrayOf(Schema componentSchema) {
    return new Schema(Type.ARRAY, null, componentSchema, null, null, null, null, null);
  }
151120
protected TableSchema getSchema() {
    List<TableFieldSchema> fields = new ArrayList<>();
    for (Map.Entry<String, FieldInfo<InputT>> entry : fieldInfo.entrySet()) {
      String key = entry.getKey();
      FieldInfo<InputT> fcnInfo = entry.getValue();
      String bqType = fcnInfo.getFieldType();
      fields.add(new TableFieldSchema().setName(key).setType(bqType));
    }
    return new TableSchema().setFields(fields);
  }
1306192
private final UIComponent createComponent(FacesContext facesContext, 
            final String componentType) throws FacesException
    {
        checkNull(componentType, "componentType");
        checkEmpty(componentType, "componentType");

        final Class<? extends UIComponent> componentClass =
                getObjectFromClassMap(componentType, _componentClassMap);
        if (componentClass == null)
        {
            log.log(Level.SEVERE, "Undefined component type " + componentType);
            throw new FacesException("Undefined component type " + componentType);
        }

        try
        {
            UIComponent component = componentClass.newInstance();
            _handleAnnotations(facesContext, component, component);
            return component;
        }
        catch (Exception e)
        {
            log.log(Level.SEVERE, "Could not instantiate component componentType = " + componentType, e);
            throw new FacesException("Could not instantiate component componentType = " + componentType, e);
        }
    }
395488
public static <T> Schema<T> createFrom(MappedSchema<T> ms, 
            Instantiator<T> instantiator, 
            Factory vf, 
            Predicate.Factory pf, 
            String ... args)
    {
        return vf.create(ms.typeClass, ms.fields, ms.fieldsByNumber, 
                ms.fieldsByName, instantiator, pf, args);
    }
686117
public static Schema partitionFieldSchema(FieldPartitioner<?, ?> fp, Schema schema) {
    if (fp instanceof IdentityFieldPartitioner) {
      // copy the schema directly from the entity to preserve annotations
      return fieldSchema(schema, fp.getSourceName());
    } else {
      Class<?> fieldType = getPartitionType(fp, schema);
      if (fieldType == Integer.class) {
        return Schema.create(Schema.Type.INT);
      } else if (fieldType == Long.class) {
        return Schema.create(Schema.Type.LONG);
      } else if (fieldType == String.class) {
        return Schema.create(Schema.Type.STRING);
      } else {
        throw new ValidationException(
            "Cannot encode partition " + fp.getName() +
                " with type " + fp.getSourceType()
        );
      }
    }
  }
45820
public int setColumnIndexUsingSchema(NodeSchema inputSchema) {
        int index = inputSchema.getIndexOfTve(this);
        if (index < 0) {
            //* enable to debug*/ System.out.println("DEBUG: setColumnIndex miss: " + this);
            //* enable to debug*/ System.out.println("DEBUG: setColumnIndex candidates: " + inputSchema);
            return index;
        }

        setColumnIndex(index);
        if (getValueType() == null) {
            // In case of sub-queries the TVE may not have its
            // value type and size resolved yet. Try to resolve it now
            SchemaColumn inputColumn = inputSchema.getColumn(index);
            setTypeSizeAndInBytes(inputColumn);
        }
        return index;
    }
762381
public static Schema toDatavecSchema(org.apache.arrow.vector.types.pojo.Schema schema) {
        Schema.Builder schemaBuilder = new Schema.Builder();
        for (int i = 0; i < schema.getFields().size(); i++) {
            schemaBuilder.addColumn(metaDataFromField(schema.getFields().get(i)));
        }
        return schemaBuilder.build();
    }
366484
function buildSchema(jsObj, key) {
  if (jsObj === undefined) return null;

  var type = typeOf(jsObj);
  switch (type) {
    case "array":
      {
        let schema = {
          type: "list",
          detail: buildSchema(jsObj[0])
        };
        key && (schema.name = key);
        return schema;
      }
    case "object":
      {
        let schema = {
          type: "map",
          detail: []
        };
        key && (schema.name = key);
        let keys = Object.keys(jsObj);
        for (var i in keys) {
          let key = keys[i];
          if (jsObj[key] !== undefined) {
            schema.detail.push(buildSchema(jsObj[key], key));
          }
        }
        return schema;
      }
    case "null":
    case "string":
    case "number":
    case "date":
    case "boolean":
      {
        let schema = {
          type: type
        };
        key && (schema.name = key);
        return schema;
      }
    default:
      throw Error("Unacceptable type : " + type);
  }
}
1203833
private JsonElement parseJsonArrayType(JsonSchema schema, JsonElement value)
      throws DataConversionException {
    Type arrayType = schema.getTypeOfArrayItems();
    JsonArray tempArray = new JsonArray();
    if (Type.isPrimitive(arrayType)) {
      return value;
    }
    JsonSchema nestedSchema = schema.getItemsWithinDataType();
    for (JsonElement v : value.getAsJsonArray()) {
      tempArray.add(parse(v, nestedSchema));
    }
    return tempArray;
  }
196893
public void setKeySchema(java.util.Collection<KeySchemaElement> keySchema) {
        if (keySchema == null) {
            this.keySchema = null;
            return;
        }

        this.keySchema = new java.util.ArrayList<KeySchemaElement>(keySchema);
    }
637336
private void createSchema() throws SQLException {
		logger.entering(CLASSNAME, "createSchema");
		Connection conn = getConnectionToDefaultSchema();

		logger.log(Level.INFO, schema + " schema does not exists. Trying to create it.");
		PreparedStatement ps = null;
		ps = conn.prepareStatement("CREATE SCHEMA " + schema);
		ps.execute();

		cleanupConnection(conn, null, ps);
		logger.exiting(CLASSNAME, "createSchema");
	}
1184093
public static Schema fromStructType(StructType structType) {
        Schema.Builder builder = new Schema.Builder();
        StructField[] fields = structType.fields();
        String[] fieldNames = structType.fieldNames();
        for (int i = 0; i < fields.length; i++) {
            String name = fields[i].dataType().typeName().toLowerCase();
            switch (name) {
                case "double":
                    builder.addColumnDouble(fieldNames[i]);
                    break;
                case "float":
                    builder.addColumnFloat(fieldNames[i]);
                    break;
                case "long":
                    builder.addColumnLong(fieldNames[i]);
                    break;
                case "int":
                case "integer":
                    builder.addColumnInteger(fieldNames[i]);
                    break;
                case "string":
                    builder.addColumnString(fieldNames[i]);
                    break;
                default:
                    throw new RuntimeException("Unknown type: " + name);
            }
        }

        return builder.build();
    }
596080
public static org.apache.arrow.vector.types.pojo.Schema toArrowSchema(Schema schema) {
        List<Field> fields = new ArrayList<>(schema.numColumns());
        for(int i = 0; i < schema.numColumns(); i++) {
            fields.add(getFieldForColumn(schema.getName(i),schema.getType(i)));
        }

        return new org.apache.arrow.vector.types.pojo.Schema(fields);
    }
1262190
def schemas
      @content['components']['schemas'].each_with_object([]) do |(key, value), results|
        schema_content = { name: key, definition: value}
        schema = Openapi2ruby::Openapi::Schema.new(schema_content)
        results << schema unless schema.properties.empty?
      end
    end
1312661
public Schema createSchema(SAXSource source, PropertyMap properties)
            throws IOException, SAXException, IncorrectSchemaException {
    ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
    CountingErrorHandler ceh = new CountingErrorHandler(eh);
    InputSource in = source.getInputSource();
    String systemId = in.getSystemId();
    IfValidHandler ifValidHandler = new IfValidHandler();
    ifValidHandler.setErrorHandler(ceh);
    try {
      SAXTransformerFactory factory = (SAXTransformerFactory)transformerFactoryClass.newInstance();
      initTransformerFactory(factory);
      TransformerHandler transformerHandler = factory.newTransformerHandler(schematron);
      ifValidHandler.setDelegate(transformerHandler);
      Transformer transformer = transformerHandler.getTransformer();
      String phase = properties.get(SchematronProperty.PHASE);
      if (phase != null)
        transformer.setParameter("phase", phase);
      boolean diagnose = properties.contains(SchematronProperty.DIAGNOSE);
      if (diagnose)
        transformer.setParameter("diagnose", Boolean.TRUE);
      PropertyMapBuilder builder = new PropertyMapBuilder(properties);
      builder.put(ValidateProperty.ERROR_HANDLER, ifValidHandler);
      Validator validator = schematronSchema.createValidator(builder.toPropertyMap());
      ifValidHandler.setValidator(validator.getContentHandler());
      XMLReader xr = source.getXMLReader();
      if (xr == null)
        xr = ResolverFactory.createResolver(properties).createXMLReader();
      xr.setContentHandler(ifValidHandler);      
      xr.setDTDHandler(validator.getDTDHandler());  // not strictly necessary
      factory.setErrorListener(new SAXErrorListener(ceh, systemId));
      TemplatesHandler templatesHandler = factory.newTemplatesHandler();
      templatesHandler.setSystemId(systemId);
      LocationFilter stage2 = new LocationFilter(new ErrorFilter(templatesHandler, ceh, localizer), systemId);
      transformerHandler.setResult(new SAXResult(stage2));
      xr.setErrorHandler(ceh);
      xr.parse(in);
      SAXException exception = stage2.getException();
      if (exception != null)
        throw exception;
      if (ceh.getHadErrorOrFatalError())
        throw new IncorrectSchemaException();
      // Getting the templates can cause errors to be generated.
      Templates templates = templatesHandler.getTemplates();
      if (ceh.getHadErrorOrFatalError())
        throw new IncorrectSchemaException();
      return new SchemaImpl(templates,
                            transformerFactoryClass,
                            properties,
                            supportedPropertyIds);
    }
    catch (SAXException e) {
      throw cleanupSAXException(e);
    }
    catch (TransformerConfigurationException e) {
      throw new SAXException(localizer.message("unexpected_schema_creation_error"));
    }
    catch (InstantiationException e) {
      throw new SAXException(e);
    }
    catch (IllegalAccessException e) {
      throw new SAXException(e);
    }
  }
841724
public static ResolvableType forArrayComponent(ResolvableType componentType) {
        LettuceAssert.notNull(componentType, "Component type must not be null");
        Class<?> arrayClass = Array.newInstance(componentType.resolve(), 0).getClass();
        return new ResolvableType(arrayClass, null, null, componentType);
    }
772172
public static Schema.Field[] flatSchema(Schema s) {
    List<Schema.Field> fields = s.getFields();
    Schema.Field[] flatSchema = new Schema.Field[fields.size()];
    int cnt = 0;
    for (Schema.Field f : fields) {
      if (isSupportedSchema(f.schema())) {
        flatSchema[cnt] = f;
        cnt++;
      }
    }
    // Return resized array
    return cnt != flatSchema.length ? Arrays.copyOf(flatSchema, cnt) : flatSchema;
  }