/** * Specifies object's compression format. Valid values: NONE, GZIP. Default Value: NONE. */ public InputSerialization withCompressionType(String compressionType) { setCompressionType(compressionType); return this; }
/** * Sets the serialization of a CSV-encoded object. * * @param csvInput The new csv value. * @return This object for method chaining. */ public InputSerialization withCsv(CSVInput csvInput) { setCsv(csvInput); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCsv() == null) ? 0 : getCsv().hashCode()); hashCode = prime * hashCode + ((getJson() == null) ? 0 : getJson().hashCode()); hashCode = prime * hashCode + ((getCompressionType() == null) ? 0 : getCompressionType().hashCode()); return hashCode; }
private static SelectObjectContentRequest generateBaseCSVRequest(String bucket, String key, String query) { SelectObjectContentRequest request = new SelectObjectContentRequest(); request.setBucketName(bucket); request.setKey(key); request.setExpression(query); request.setExpressionType(ExpressionType.SQL); InputSerialization inputSerialization = new InputSerialization(); inputSerialization.setCsv(new CSVInput()); inputSerialization.setCompressionType(CompressionType.NONE); request.setInputSerialization(inputSerialization); OutputSerialization outputSerialization = new OutputSerialization(); outputSerialization.setCsv(new CSVOutput()); request.setOutputSerialization(outputSerialization); return request; } }
private static void addInputSerializationIfNotNull(XmlWriter xml, InputSerialization inputSerialization) { if (inputSerialization != null) { xml.start("InputSerialization"); if (inputSerialization.getCsv() != null) { xml.start("CSV"); CSVInput csvInput = inputSerialization.getCsv(); addIfNotNull(xml, "FileHeaderInfo", csvInput.getFileHeaderInfo()); addIfNotNull(xml, "Comments", csvInput.getCommentsAsString()); addIfNotNull(xml, "QuoteEscapeCharacter", csvInput.getQuoteEscapeCharacterAsString()); addIfNotNull(xml, "RecordDelimiter", csvInput.getRecordDelimiterAsString()); addIfNotNull(xml, "FieldDelimiter", csvInput.getFieldDelimiterAsString()); addIfNotNull(xml, "QuoteCharacter", csvInput.getQuoteCharacterAsString()); addIfNotNull(xml, "AllowQuotedRecordDelimiter", csvInput.getAllowQuotedRecordDelimiter()); xml.end(); } if (inputSerialization.getJson() != null) { xml.start("JSON"); JSONInput jsonInput = inputSerialization.getJson(); addIfNotNull(xml, "Type", jsonInput.getType()); xml.end(); } if (inputSerialization.getParquet() != null) { xml.start("Parquet"); xml.end(); } addIfNotNull(xml, "CompressionType", inputSerialization.getCompressionType()); xml.end(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || ! (obj instanceof SelectParameters)) { return false; } final SelectParameters other = (SelectParameters) obj; if (other.getInputSerialization() == null ^ this.getInputSerialization() == null) return false; if (other.getInputSerialization() != null && !other.getInputSerialization().equals(this.getInputSerialization())) return false; if (other.getExpressionType() == null ^ this.getExpressionType() == null) return false; if (other.getExpressionType() != null && !other.getExpressionType().equals(this.getExpressionType())) return false; if (other.getExpression() == null ^ this.getExpression() == null) return false; if (other.getExpression() != null && !other.getExpression().equals(this.getExpression())) return false; if (other.getOutputSerialization() == null ^ this.getOutputSerialization() == null) return false; if (other.getOutputSerialization() != null && !other.getOutputSerialization().equals(this.getOutputSerialization())) return false; return true; }
selectObjectCSVInputSerialization.setQuoteCharacter(quoteChar); selectObjectCSVInputSerialization.setQuoteEscapeCharacter(escapeChar); InputSerialization selectObjectInputSerialization = new InputSerialization(); selectObjectInputSerialization.setCompressionType(CompressionType.GZIP); selectObjectInputSerialization.setCompressionType(CompressionType.BZIP2); selectObjectInputSerialization.setCsv(selectObjectCSVInputSerialization); selectObjectRequest.setInputSerialization(selectObjectInputSerialization);
selectObjectCSVInputSerialization.setQuoteCharacter(quoteChar); selectObjectCSVInputSerialization.setQuoteEscapeCharacter(escapeChar); InputSerialization selectObjectInputSerialization = new InputSerialization(); selectObjectInputSerialization.setCompressionType(CompressionType.GZIP); selectObjectInputSerialization.setCompressionType(CompressionType.BZIP2); selectObjectInputSerialization.setCsv(selectObjectCSVInputSerialization); selectObjectRequest.setInputSerialization(selectObjectInputSerialization);
/** * Specifies object's compression format. Valid values: NONE, GZIP. Default Value: NONE. */ public InputSerialization withCompressionType(CompressionType compressionType) { setCompressionType(compressionType); return this; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || ! (obj instanceof InputSerialization)) { return false; } final InputSerialization other = (InputSerialization) obj; if (other.getCsv() == null ^ this.getCsv() == null) return false; if (other.getCsv() != null && !other.getCsv().equals(this.getCsv())) return false; if (other.getJson() == null ^ this.getJson() == null) return false; if (other.getJson() != null && !other.getJson().equals(this.getJson())) return false; if (other.getCompressionType() == null ^ this.getCompressionType() == null) return false; if (other.getCompressionType() != null && !other.getCompressionType().equals(this.getCompressionType())) return false; return true; }
/** * Specifies object's compression format. Valid values: NONE, GZIP. Default Value: NONE. */ public void setCompressionType(CompressionType compressionType) { setCompressionType(compressionType == null ? null : compressionType.toString()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCsv() != null) sb.append("Csv: ").append(getCsv()); if (getJson() != null) sb.append("Json: ").append(getJson()); if (getCompressionType() != null) sb.append("CompressionType: ").append(getCompressionType()); sb.append("}"); return sb.toString(); }