@Override
    public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
        writer.keyword("CREATE");

        if (getReplace()) {
            writer.keyword("OR REPLACE");
        }

        writer.keyword("EXTERNAL MAPPING");

        if (ifNotExists) {
            writer.keyword("IF NOT EXISTS");
        }

        name.unparse(writer, leftPrec, rightPrec);
        if (externalName != null) {
            writer.keyword("EXTERNAL NAME");
            externalName.unparse(writer, leftPrec, rightPrec);
        }

        if (!columns.isEmpty()) {
            SqlWriter.Frame frame = writer.startList("(", ")");
            for (SqlNode column : columns) {
                printIndent(writer);
                column.unparse(writer, 0, 0);
            }
            writer.newlineAndIndent();
            writer.endList(frame);
        }

        if (dataConnection != null) {
            writer.newlineAndIndent();
            writer.keyword("DATA CONNECTION");
            dataConnection.unparse(writer, leftPrec, rightPrec);
        } else {
            assert connectorType != null;
            writer.newlineAndIndent();
            writer.keyword("TYPE");
            connectorType.unparse(writer, leftPrec, rightPrec);
        }

        if (objectType != null) {
            writer.newlineAndIndent();
            writer.keyword("OBJECT TYPE");
            objectType.unparse(writer, leftPrec, rightPrec);
        }

        unparseOptions(writer, options);
    }
@Test
    public void test_unparse_quoting() {
        Mapping mapping = new Mapping(
                "na\"me",
                "external\"name",
                null,
                "Type",
                null,
                singletonList(new MappingField("fi\"eld", QueryDataType.VARCHAR, "__key\"field")),
                ImmutableMap.of("ke'y", "val'ue")
        );

        String sql = SqlCreateMapping.unparse(mapping);
        assertThat(sql).isEqualTo("CREATE OR REPLACE EXTERNAL MAPPING \"hazelcast\".\"public\".\"na\"\"me\" " +
                "EXTERNAL NAME \"external\"\"name\" (" + LE +
                "  \"fi\"\"eld\" VARCHAR EXTERNAL NAME \"__key\"\"field\"" + LE +
                ")" + LE +
                "TYPE \"Type\"" + LE +
                "OPTIONS (" + LE +
                "  'ke''y'='val''ue'" + LE +
                ")"
        );
    }