Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
statistics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
702
HADOOP
statistics
Commits
9f98f2b6
Commit
9f98f2b6
authored
Jan 9, 2018
by
František Dvořák
Browse files
Options
Downloads
Patches
Plain Diff
Generic HDFS path in external Hive tables
parent
c5363491
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
2-import/README
+0
-7
0 additions, 7 deletions
2-import/README
2-import/hive-import.sh
+4
-3
4 additions, 3 deletions
2-import/hive-import.sh
2-import/hive.sql.in
+7
-7
7 additions, 7 deletions
2-import/hive.sql.in
with
11 additions
and
17 deletions
2-import/README
deleted
100644 → 0
+
0
−
7
View file @
c5363491
1. 1. 2015 ... 1.1.2016
1.1.2016 ... 1.1.2017
1420070400 ... 1451606400
1451606400 ... 1483228800
SELECT id, name, user, submit, start, finish, memory_seconds, cpu_seconds, nmap, nreduce FROM jobs WHERE start >= 1420070400L*1000 AND finish < 1451606400L*1000;
This diff is collapsed.
Click to expand it.
2-import/hive-import.sh
+
4
−
3
View file @
9f98f2b6
...
...
@@ -26,8 +26,8 @@ for action in ${ACTIONS}; do
hdfs dfs
-rm
-r
${
HDFS_PATH
}
||
:
hdfs dfs
-mkdir
-p
${
HDFS_PATH
}
/jobs/
for
t
in
${
TABLES
}
;
do
hdfs dfs
-mkdir
/user/valtri/statistics
/jobs/
${
t
}
||
: 2>/dev/null
hdfs dfs
-put
${
LOCAL_PATH
}
/
${
t
}
.csv
/user/valtri/statistics
/jobs/
${
t
}
/
hdfs dfs
-mkdir
${
HDFS_PATH
}
/jobs/
${
t
}
||
: 2>/dev/null
hdfs dfs
-put
${
LOCAL_PATH
}
/
${
t
}
.csv
${
HDFS_PATH
}
/jobs/
${
t
}
/
done
;;
...
...
@@ -36,8 +36,9 @@ for action in ${ACTIONS}; do
;;
init
)
sed
-e
"s,@HDFS_PATH@,
$HDFS_PATH
,g"
"
${
BASE_PATH
}
/hive.sql.in"
>
hive.sql
beeline
-u
$JDBC_URL
-e
"CREATE DATABASE
$DBNAME
"
beeline
-u
$JDBC_URL
-f
"
${
BASE_PATH
}
/
hive.sql
"
beeline
-u
$JDBC_URL
-f
hive.sql
;;
esac
...
...
This diff is collapsed.
Click to expand it.
2-import/hive.sql
→
2-import/hive.sql
.in
+
7
−
7
View file @
9f98f2b6
...
...
@@ -16,7 +16,7 @@ CREATE EXTERNAL TABLE jobs (
changed TIMESTAMP
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/jobs'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/jobs'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -30,7 +30,7 @@ CREATE EXTERNAL TABLE subjobs (
finish BIGINT
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/subjobs'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/subjobs'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -42,7 +42,7 @@ CREATE EXTERNAL TABLE jobnodes (
nreduce INT
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/jobnodes'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/jobnodes'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -55,7 +55,7 @@ CREATE EXTERNAL TABLE jobcounters (
total BIGINT
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/jobcounters'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/jobcounters'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -65,7 +65,7 @@ CREATE EXTERNAL TABLE counters (
name CHAR(128)
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/counters'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/counters'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -74,7 +74,7 @@ CREATE EXTERNAL TABLE nodes (
host VARCHAR(256)
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/nodes'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/nodes'
TBLPROPERTIES("skip.header.line.count"="1");
...
...
@@ -83,5 +83,5 @@ CREATE EXTERNAL TABLE intervals (
finish INT
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED
AS
TEXTFILE
LOCATION
'
/user/valtri/statistics
/jobs/intervals/'
STORED AS TEXTFILE LOCATION '
@HDFS_PATH@
/jobs/intervals/'
TBLPROPERTIES("skip.header.line.count"="1");
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment