Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
embulk-parser-none-bin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Klaus Wölfel
embulk-parser-none-bin
Commits
642f276b
Commit
642f276b
authored
Feb 22, 2016
by
sonots
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename message_key => column_name
parent
922eae0d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
README.md
README.md
+4
-3
example.yml
example.yml
+2
-3
src/main/java/org/embulk/parser/NoneParserPlugin.java
src/main/java/org/embulk/parser/NoneParserPlugin.java
+6
-6
No files found.
README.md
View file @
642f276b
...
@@ -15,7 +15,7 @@ $ embulk gem install embulk-parser-none
...
@@ -15,7 +15,7 @@ $ embulk gem install embulk-parser-none
## Configuration
## Configuration
-
**
message_key**
: A column name which this plugin outputs (string, default: "message
")
-
**
column_name**
: A column name which this plugin outputs (string, default: "payload
")
## Example
## Example
...
@@ -25,7 +25,7 @@ in:
...
@@ -25,7 +25,7 @@ in:
path_prefix
:
example.txt
path_prefix
:
example.txt
parser
:
parser
:
type
:
none
type
:
none
message_key
:
message
column_name
:
payload
```
```
Assume the input file (example.txt) is as following:
Assume the input file (example.txt) is as following:
...
@@ -39,7 +39,7 @@ then this plugin treats as:
...
@@ -39,7 +39,7 @@ then this plugin treats as:
```
```
+----------------+
+----------------+
|
message
:string |
|
payload
:string |
+----------------+
+----------------+
| foo bar baz |
| foo bar baz |
| foo bar baz |
| foo bar baz |
...
@@ -82,6 +82,7 @@ out:
...
@@ -82,6 +82,7 @@ out:
Run example:
Run example:
```
```
$ embulk gem install embulk-formatter-single_value
$ ./gradlew classpath
$ ./gradlew classpath
$ embulk run -I lib example.yml
$ embulk run -I lib example.yml
```
```
...
...
example.yml
View file @
642f276b
...
@@ -3,12 +3,11 @@ in:
...
@@ -3,12 +3,11 @@ in:
path_prefix
:
example.txt
path_prefix
:
example.txt
parser
:
parser
:
type
:
none
type
:
none
message_key
:
message
column_name
:
payload
out
:
out
:
type
:
file
type
:
file
path_prefix
:
example.txt
path_prefix
:
example.txt
sequence_format
:
"
"
sequence_format
:
"
"
file_ext
:
.out
file_ext
:
.out
formatter
:
formatter
:
type
:
csv
type
:
single_value
quote_policy
:
NONE
src/main/java/org/embulk/parser/NoneParserPlugin.java
View file @
642f276b
...
@@ -33,9 +33,9 @@ public class NoneParserPlugin
...
@@ -33,9 +33,9 @@ public class NoneParserPlugin
public
interface
PluginTask
public
interface
PluginTask
extends
Task
,
LineDecoder
.
DecoderTask
//, TimestampParser.Task
extends
Task
,
LineDecoder
.
DecoderTask
//, TimestampParser.Task
{
{
@Config
(
"
message_key
"
)
@Config
(
"
column_name
"
)
@ConfigDefault
(
"\"
message
\""
)
@ConfigDefault
(
"\"
payload
\""
)
public
String
get
MessageKey
();
public
String
get
ColumnName
();
}
}
@Override
@Override
...
@@ -43,9 +43,9 @@ public class NoneParserPlugin
...
@@ -43,9 +43,9 @@ public class NoneParserPlugin
{
{
PluginTask
task
=
config
.
loadConfig
(
PluginTask
.
class
);
PluginTask
task
=
config
.
loadConfig
(
PluginTask
.
class
);
ArrayList
<
ColumnConfig
>
columns
=
new
ArrayList
<
ColumnConfig
>();
ArrayList
<
ColumnConfig
>
columns
=
new
ArrayList
<
ColumnConfig
>();
final
String
messageKey
=
task
.
getMessageKey
();
final
String
columnName
=
task
.
getColumnName
();
columns
.
add
(
new
ColumnConfig
(
messageKey
,
STRING
,
config
));
columns
.
add
(
new
ColumnConfig
(
columnName
,
STRING
,
config
));
Schema
schema
=
new
SchemaConfig
(
columns
).
toSchema
();
Schema
schema
=
new
SchemaConfig
(
columns
).
toSchema
();
control
.
run
(
task
.
dump
(),
schema
);
control
.
run
(
task
.
dump
(),
schema
);
...
@@ -59,7 +59,7 @@ public class NoneParserPlugin
...
@@ -59,7 +59,7 @@ public class NoneParserPlugin
LineDecoder
lineDecoder
=
new
LineDecoder
(
input
,
task
);
LineDecoder
lineDecoder
=
new
LineDecoder
(
input
,
task
);
PageBuilder
pageBuilder
=
new
PageBuilder
(
Exec
.
getBufferAllocator
(),
schema
,
output
);
PageBuilder
pageBuilder
=
new
PageBuilder
(
Exec
.
getBufferAllocator
(),
schema
,
output
);
String
line
=
null
;
String
line
=
null
;
final
String
messageKey
=
task
.
getMessageKey
();
final
String
columnName
=
task
.
getColumnName
();
while
(
input
.
nextFile
()
){
while
(
input
.
nextFile
()
){
while
(
true
){
while
(
true
){
...
...
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