func getContentDetail()

in example/sink/oss_sink_sample.go [91:148]


func getContentDetail(contentType sls.OSSContentType) interface{} {
	if contentType == sls.OSSContentDetailTypeCSV {
		// default csvDetail ,you can replace the parameters
		csvDetail := sls.CsvContentDetail{
			ColumnNames: append(make([]string, 0), "k1", "k2"), // column key
			Delimiter:   ",",                                   // you can set " " , "|" , "," and "\t"
			Quote:       "\"",                                  // you can set "'" (single quote)  , "\"" (double quote) and ""
			Escape:      "\"",
			Null:        "",
			Header:      true,
			LineFeed:    "\n",
		}
		return csvDetail
	}

	if contentType == sls.OSSContentDetailTypeJSON {
		// default enableTag
		jsonDetail := sls.JsonContentDetail{
			EnableTag: true,
		}
		return jsonDetail
	}
	if contentType == "parquet" {
		parquetDetail := sls.ParquetContentDetail{
			Columns: []sls.Column{
				{Name: "newline", Type: "string"},
				{Name: "chinese", Type: "string"},
				{Name: "special characters", Type: "string"},
				{Name: "normal", Type: "string"},
				{Name: "user_escape", Type: "string"},
				{Name: "int32_field", Type: "int32"},
				{Name: "int64_field", Type: "int64"},
				{Name: "boolean_field", Type: "boolean"},
				{Name: "float_field", Type: "float"},
				{Name: "double_field", Type: "double"},
			},
		}
		return parquetDetail
	}
	if contentType == "orc" {
		orcDetail := sls.OrcContentDetail{
			Columns: []sls.Column{
				{Name: "newline", Type: "string"},
				{Name: "chinese", Type: "string"},
				{Name: "special characters", Type: "string"},
				{Name: "normal", Type: "string"},
				{Name: "user_escape", Type: "string"},
				{Name: "int32_field", Type: "int32"},
				{Name: "int64_field", Type: "int64"},
				{Name: "boolean_field", Type: "boolean"},
				{Name: "float_field", Type: "float"},
				{Name: "double_field", Type: "double"},
			},
		}
		return orcDetail
	}
	return nil
}