Gets the JSON representation of the table's fields.

@param tableSchema {@link TableSchema} to get JSON fields from
@return the JSON of the fields.
@throws IOException
331506
static String getTableFieldsJson(TableSchema tableSchema) throws IOException {
    return JacksonFactory.getDefaultInstance().toString(tableSchema.getFields());
  }
769946
public static JsonValue serializeAsJson(Object o) throws IOException {
        try {
            return findFieldsToSerialize(o).mainObject;
        } catch (IllegalStateException ise) {
            // the reflective attempt to build the object failed.
            throw new IOException("Unable to build JSON for Object", ise);
        } catch (JsonException e) {
            throw new IOException("Unable to build JSON for Object", e);
        }
    }
744184
public String getSearchJsonModel() throws IOException {
        DbSearch search = new DbSearch();
        search.setArtifacts(new ArrayList<>());
        search.setModules(new ArrayList<>());
        return JsonUtils.serialize(search);
    }
451387
@Override
  public JsonArray convertSchema(String inputSchema, WorkUnitState workUnit) throws SchemaConversionException {
    JsonParser jsonParser = new JsonParser();
    JsonElement jsonSchema = jsonParser.parse(inputSchema);
    return jsonSchema.getAsJsonArray();
  }
521619
public static String serializeAsString(Object o) throws IOException {
        try {
            JsonStructure builtJsonObject = findFieldsToSerialize(o).mainObject;
            return builtJsonObject.toString();
        } catch (IllegalStateException ise) {
            // the reflective attempt to build the object failed.
            throw new IOException("Unable to build JSON for Object", ise);
        } catch (JsonException e) {
            throw new IOException("Unable to build JSON for Object", e);
        }
    }
152630
public function getTableSchema(): ?TableSchema
    {
        if ($this->_tableSchema === null) {
            $this->_tableSchema = $this->db->getTableSchema($this->tableName);
        }

        return $this->_tableSchema;
    }
1294546
public JsonNode toJson() {
		ObjectMapper mapper = new ObjectMapper();
		ObjectNode node = mapper.createObjectNode();

		ArrayNode columnsNode = mapper.createArrayNode();
		for (DataColumn column : columns) {
			columnsNode.add(column.toJson());
		}
		ArrayNode dataNode = mapper.createArrayNode();
		for (DataRow row : rows) {
			dataNode.add(row.toJson());
		}

		node.put("columns", columnsNode);
		node.put("data", dataNode);
		node.put("overwrite", overwritePolicy.toJson());
		if (templateId != null) {
			node.put("templateId", templateId);
		}
		if (splitByColumn != null) {
			node.put("splitByColumn", splitByColumn);
		}
		return node;
	}
458831
public String getKeySchema() throws IOException {
        Schema schema = getInputPathAvroSchema();
        String keySchema = schema.getField(keyFieldName).schema().toString();
        return keySchema;
    }
1297635
public static JWEHeader deserialize(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, JWEHeader.class);
    }
112430
public String getDependencyJsonModel() throws IOException {
        final Artifact artifact = DataModelFactory.createArtifact("","","","","","","");
        return JsonUtils.serialize(DataModelFactory.createDependency(artifact, Scope.COMPILE));
    }
1068070
static TableSchema parseTableSchema(String tableSchemaJson) throws IOException {
    JsonParser parser = JacksonFactory.getDefaultInstance().createJsonParser(tableSchemaJson);
    return parser.parseAndClose(TableSchema.class);
  }
476431
public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception {
        SchemaLoader.builder()
                 .useDefaults(true)
                 .schemaJson(schema)
                 .build()
                 .load()
                 .build()
                 .validate(json);
        return true;
    }
313929
public JsonSchema getValuesWithinDataType() {
    JsonElement element = this.getDataType().get(MAP_ITEMS_KEY);
    if (element.isJsonObject()) {
      return new JsonSchema(element.getAsJsonObject());
    }
    if (element.isJsonArray()) {
      return new JsonSchema(element.getAsJsonArray());
    }
    if (element.isJsonPrimitive()) {
      return buildBaseSchema(Type.valueOf(element.getAsString().toUpperCase()));
    }
    throw new UnsupportedOperationException(
        "Map values can only be defined using JsonObject, JsonArray or JsonPrimitive.");
  }
502222
public String toJson()
      throws IOException {
    StringWriter writer = new StringWriter();
    try (JsonGenerator generator = jsonFactory.createJsonGenerator(writer)
        .setCodec(objectMapper)) {
      toJsonUtf8(generator);
    }

    return writer.toString();
  }
378119
public TableMetadata fetchTableMetadata() {

        Metadata metadata = getSession().getCluster().getMetadata();
        KeyspaceMetadata ksMetadata = metadata.getKeyspace(quote(this.catalog));

        if (ksMetadata != null) {
            return ksMetadata.getTable(quote(this.table));
        } else {
            return null;
        }
    }
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();
    }
282618
public JsonNode getApplicationsTree() throws IOException {
        Invocation invocation = getJerseyClient().target(getEndpoint() + "/v1/applications/fetch").request().buildGet();
        return invocation.invoke().readEntity(JsonNode.class);
    }