File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
odps-sdk/odps-sdk-core/src
main/java/com/aliyun/odps/sqa/commandapi
test/java/com/aliyun/odps/data/converter Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ class DescribeTableCommand implements Command {
7474 private static final Map <String , TypeInfo > extendedTableMap = new LinkedHashMap <>(tableMap );
7575
7676 static {
77+ extendedTableMap .replace ("NativeColumns" , TypeInfoFactory .getArrayTypeInfo (getExtendedStructTypeInfo ()));
7778 extendedTableMap .put ("ExtendedInfo" , TypeInfoFactory
7879 .getMapTypeInfo (TypeInfoFactory .STRING , TypeInfoFactory .STRING ));
7980 extendedTableMap .put ("ExtendedInfoJson" , TypeInfoFactory .STRING );
Original file line number Diff line number Diff line change 1+ package com .aliyun .odps .data .converter ;
2+
3+ import org .junit .Test ;
4+
5+ import com .aliyun .odps .Odps ;
6+ import com .aliyun .odps .commons .transport .OdpsTestUtils ;
7+ import com .aliyun .odps .data .Record ;
8+ import com .aliyun .odps .sqa .SQLExecutor ;
9+ import com .aliyun .odps .sqa .SQLExecutorBuilder ;
10+
11+ /**
12+ * @author dingxin ([email protected] ) 13+ */
14+ public class FormatStructTest {
15+
16+ static OdpsRecordConverter odpsRecordConverter ;
17+
18+ static {
19+ odpsRecordConverter = OdpsRecordConverter .builder ()
20+ .setStrictMode (false )
21+ .enableParseNull ()
22+ .build ();
23+ }
24+
25+ @ Test
26+ public void testListStruct () throws Exception {
27+ Odps odps = OdpsTestUtils .newDefaultOdps ();
28+ SQLExecutor sqlExecutor = SQLExecutorBuilder .builder ().odps (odps )
29+ .enableCommandApi (true )
30+ .useInstanceTunnel (true )
31+ .build ();
32+ sqlExecutor .run ("desc extended test;" , null );
33+
34+ Record record = sqlExecutor .getResult ().get (0 );
35+
36+ String [] strings = odpsRecordConverter .formatRecord (record );
37+ for (String string : strings ) {
38+ System .out .println (string );
39+ }
40+ }
41+
42+
43+
44+ }
You can’t perform that action at this time.
0 commit comments