private void analyzeProperties() throws SemanticException {
        setBrokerProperties();
        if (brokerDesc == null) {
            return;
        }

        if (properties.containsKey(PROP_COLUMN_SEPARATOR)) {
            if (!isCsvFormat()) {
                throw new SemanticException(PROP_COLUMN_SEPARATOR + " is only for CSV format");
            }
            columnSeparator = Delimiter.convertDelimiter(properties.get(PROP_COLUMN_SEPARATOR));
        }

        if (properties.containsKey(PROP_LINE_DELIMITER)) {
            if (!isCsvFormat()) {
                throw new SemanticException(PROP_LINE_DELIMITER + " is only for CSV format");
            }
            rowDelimiter = Delimiter.convertDelimiter(properties.get(PROP_LINE_DELIMITER));
        }

        if (properties.containsKey(PARQUET_COMPRESSION_TYPE)) {
            if (!isParquetFormat()) {
                throw new SemanticException(PARQUET_COMPRESSION_TYPE + " is only for PARQUET format");
            }
            String type = properties.get(PARQUET_COMPRESSION_TYPE);
            if (PARQUET_COMPRESSION_TYPE_MAP.containsKey(type)) {
                compressionType = PARQUET_COMPRESSION_TYPE_MAP.get(type);
            } else {
                throw new SemanticException("compression type is invalid, type: " + type);
            }
        }

        if (properties.containsKey(PARQUET_USE_DICT)) {
            if (!isParquetFormat()) {
                throw new SemanticException(PARQUET_USE_DICT + " is only for PARQUET format");
            }
            useDict = Boolean.parseBoolean(properties.get(PARQUET_USE_DICT));
        }

        if (properties.containsKey(PARQUET_MAX_ROW_GROUP_SIZE)) {
            if (!isParquetFormat()) {
                throw new SemanticException(PARQUET_MAX_ROW_GROUP_SIZE + " is only for PARQUET format");
            }
            try {
                maxParquetRowGroupBytes = Long.parseLong(properties.get(PARQUET_MAX_ROW_GROUP_SIZE));
            } catch (NumberFormatException e) {
                throw new SemanticException(
                        PARQUET_MAX_ROW_GROUP_SIZE + " should be a number of bytes (e.g. 134217728)");
            }
        }

        if (properties.containsKey(PROP_MAX_FILE_SIZE)) {
            try {
                maxFileSizeBytes = ParseUtil.analyzeDataVolume(properties.get(PROP_MAX_FILE_SIZE));
            } catch (AnalysisException e) {
                throw new SemanticException(e.getMessage());
            }
            if (maxFileSizeBytes > MAX_FILE_SIZE_BYTES || maxFileSizeBytes < MIN_FILE_SIZE_BYTES) {
                throw new SemanticException("max file size should between 5MB and 2GB. Given: " + maxFileSizeBytes);
            }
        }
    }
@Test
    public void testAnalyzeProperties() throws UnsupportedEncodingException {
        Scope scope = new Scope(RelationId.anonymous(), new RelationFields());
        Map<String, String> properties = Maps.newHashMap();

        // default column separator and line delimiter
        OutFileClause clause = new OutFileClause("file_path", "csv", properties);
        clause.analyze(scope);
        Assert.assertEquals("\t", clause.getColumnSeparator());
        Assert.assertEquals("\n", clause.getRowDelimiter());

        // column separator: | and line delimiter: ,
        properties.clear();
        properties.put("column_separator", "|");
        properties.put("line_delimiter", ",");
        clause = new OutFileClause("file_path", "csv", properties);
        clause.analyze(scope);
        Assert.assertEquals("|", clause.getColumnSeparator());
        Assert.assertEquals(",", clause.getRowDelimiter());

        // invisible character column separator and line delimiter
        properties.clear();
        properties.put("column_separator", "\\x01");
        properties.put("line_delimiter", "\\x02");
        clause = new OutFileClause("file_path", "csv", properties);
        clause.analyze(scope);
        Assert.assertEquals(new String(new byte[] {1}, "UTF-8"), clause.getColumnSeparator());
        Assert.assertEquals(new String(new byte[] {2}, "UTF-8"), clause.getRowDelimiter());
    }