Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DataX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
risk-feature
DataX
Commits
068b1db9
Commit
068b1db9
authored
May 23, 2018
by
mingya.wmy
Committed by
GitHub
May 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #93 from windpiger/orc-columncount
change the logic of getting orc column count in DFSUtil.java
parents
26a60356
84cfeb51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
DFSUtil.java
...a/com/alibaba/datax/plugin/reader/hdfsreader/DFSUtil.java
+1
-6
No files found.
hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/DFSUtil.java
View file @
068b1db9
...
...
@@ -486,15 +486,10 @@ public class DFSUtil {
}
private
int
getAllColumnsCount
(
String
filePath
)
{
int
columnsCount
;
final
String
colFinal
=
"_col"
;
Path
path
=
new
Path
(
filePath
);
try
{
Reader
reader
=
OrcFile
.
createReader
(
path
,
OrcFile
.
readerOptions
(
hadoopConf
));
String
type_struct
=
reader
.
getObjectInspector
().
getTypeName
();
columnsCount
=
(
type_struct
.
length
()
-
type_struct
.
replace
(
colFinal
,
""
).
length
())
/
colFinal
.
length
();
return
columnsCount
;
return
reader
.
getTypes
().
get
(
0
).
getSubtypesCount
();
}
catch
(
IOException
e
)
{
String
message
=
"读取orcfile column列数失败,请联系系统管理员"
;
throw
DataXException
.
asDataXException
(
HdfsReaderErrorCode
.
READ_FILE_ERROR
,
message
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment