[ 
https://issues.apache.org/jira/browse/FLINK-9696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530177#comment-16530177
 ] 

ASF GitHub Bot commented on FLINK-9696:
---------------------------------------

Github user snuyanzin commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6233#discussion_r199559926
  
    --- Diff: 
flink-libraries/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliUtilsTest.java
 ---
    @@ -0,0 +1,108 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.table.client.cli;
    +
    +import org.apache.flink.api.java.tuple.Tuple3;
    +import org.apache.flink.types.Row;
    +
    +import org.junit.Test;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Collection;
    +import java.util.HashMap;
    +import java.util.Map;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Tests for {@link CliUtils}.
    + */
    +public class CliUtilsTest {
    +
    +   @Test
    +   public void testRowToString() throws IOException {
    +           Row result = new Row(10);
    +           result.setField(0, null);
    +           result.setField(1, "String");
    +           result.setField(2, 'c');
    +           result.setField(3, false);
    +           result.setField(4, 12345.67f);
    +           result.setField(5, 12345.67d);
    +           result.setField(6, 12345L);
    +           result.setField(7, java.sql.Date.valueOf("2018-11-12"));
    +           result.setField(8, new int[]{1, 2});
    +           result.setField(9, new Tuple3<>(1, "123", null));
    +           assertEquals(Arrays.toString(CliUtils.rowToString(result)),
    --- End diff --
    
    Thank you for the catch.
    Corrected


> Deep toString for arrays/map in SQL client 
> -------------------------------------------
>
>                 Key: FLINK-9696
>                 URL: https://issues.apache.org/jira/browse/FLINK-9696
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>              Labels: pull-request-available
>
> Currently SQL client does not show arrays/map in human readable way (please 
> have a look at examples below). e.g. {code}select map[1,2];{code} is shown as 
> {noformat} +/-                    EXPR$0
>    +         java.util.HashMap
> {noformat}
> {code}select array[1,2];{code} is shown as {noformat}
> +/-                    EXPR$0
>    +       java.lang.Integer[]
> {noformat} 
> {code}select array[map[1,2],map[2,2]];{code} is shown as {noformat} +/-       
>              EXPR$0
>    +           java.util.Map[]{noformat}
> {code}select map[array[1,2], array[1,2]];{code} is shown as {noformat} +/-    
>                 EXPR$0
>    +         java.util.HashMap{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to