public class GraphCsvReader extends Object
CsvReader
class.Modifier and Type | Field and Description |
---|---|
protected CsvReader |
edgeReader |
protected MapFunction<?,?> |
mapper |
protected CsvReader |
vertexReader |
Constructor and Description |
---|
GraphCsvReader(Path edgePath,
ExecutionEnvironment context) |
GraphCsvReader(Path edgePath,
MapFunction<K,VV> mapper,
ExecutionEnvironment context) |
GraphCsvReader(Path vertexPath,
Path edgePath,
ExecutionEnvironment context) |
GraphCsvReader(String edgePath,
ExecutionEnvironment context) |
GraphCsvReader(String edgePath,
MapFunction<K,VV> mapper,
ExecutionEnvironment context) |
GraphCsvReader(String vertexPath,
String edgePath,
ExecutionEnvironment context) |
Modifier and Type | Method and Description |
---|---|
<K,EV> Graph<K,NullValue,EV> |
edgeTypes(Class<K> vertexKey,
Class<EV> edgeValue)
Creates a Graph from CSV input with edge values, but without vertex values.
|
GraphCsvReader |
fieldDelimiterEdges(String delimiter)
Configures the Delimiter that separates fields in a row for the CSV reader used to read the edges
(
',' ) is used by default. |
GraphCsvReader |
fieldDelimiterVertices(String delimiter)
Configures the Delimiter that separates fields in a row for the CSV reader used to read the vertices
(
',' ) is used by default. |
GraphCsvReader |
ignoreCommentsEdges(String commentPrefix)
Configures the string that starts comments for the Edge Csv Reader.
|
GraphCsvReader |
ignoreCommentsVertices(String commentPrefix)
Configures the string that starts comments for the Vertex Csv Reader.
|
GraphCsvReader |
ignoreFirstLineEdges()
Sets the CSV reader for the Edges file to ignore the first line.
|
GraphCsvReader |
ignoreFirstLineVertices()
Sets the CSV reader for the Vertices file to ignore the first line.
|
GraphCsvReader |
ignoreInvalidLinesEdges()
Sets the CSV reader for the Edges file to ignore any invalid lines.
|
GraphCsvReader |
ignoreInvalidLinesVertices()
Sets the CSV reader Vertices file to ignore any invalid lines.
|
GraphCsvReader |
includeFieldsEdges(boolean... edgeFields)
Configures which fields of the CSV file containing edges data should be included and which should be skipped.
|
GraphCsvReader |
includeFieldsEdges(long mask)
Configures which fields of the CSV file containing edges data should be included and which should be skipped.
|
GraphCsvReader |
includeFieldsEdges(String mask)
Configures which fields of the CSV file containing edges data should be included and which should be skipped.
|
GraphCsvReader |
includeFieldsVertices(boolean... vertexFields)
Configures which fields of the CSV file containing vertices data should be included and which should be skipped.
|
GraphCsvReader |
includeFieldsVertices(long mask)
Configures which fields of the CSV file containing vertices data should be included and which should be skipped.
|
GraphCsvReader |
includeFieldsVertices(String mask)
Configures which fields of the CSV file containing vertices data should be included and which should be skipped.
|
<K> Graph<K,NullValue,NullValue> |
keyType(Class<K> vertexKey)
Creates a Graph from CSV input without vertex values or edge values.
|
GraphCsvReader |
lineDelimiterEdges(String delimiter)
Configures the Delimiter that separates rows for the CSV reader used to read the edges
(
'\n' ) is used by default. |
GraphCsvReader |
lineDelimiterVertices(String delimiter)
Configures the Delimiter that separates rows for the CSV reader used to read the vertices
(
'\n' ) is used by default. |
GraphCsvReader |
parseQuotedStringsEdges(char quoteCharacter)
Enables quoted String parsing for Edge Csv Reader.
|
GraphCsvReader |
parseQuotedStringsVertices(char quoteCharacter)
Enables quoted String parsing for Vertex Csv Reader.
|
<K,VV,EV> Graph<K,VV,EV> |
types(Class<K> vertexKey,
Class<VV> vertexValue,
Class<EV> edgeValue)
Creates a Graph from CSV input with vertex values and edge values.
|
<K,VV> Graph<K,VV,NullValue> |
vertexTypes(Class<K> vertexKey,
Class<VV> vertexValue)
Creates a Graph from CSV input without edge values.
|
protected CsvReader edgeReader
protected CsvReader vertexReader
protected MapFunction<?,?> mapper
public GraphCsvReader(Path vertexPath, Path edgePath, ExecutionEnvironment context)
public GraphCsvReader(Path edgePath, ExecutionEnvironment context)
public GraphCsvReader(Path edgePath, MapFunction<K,VV> mapper, ExecutionEnvironment context)
public GraphCsvReader(String edgePath, ExecutionEnvironment context)
public GraphCsvReader(String vertexPath, String edgePath, ExecutionEnvironment context)
public GraphCsvReader(String edgePath, MapFunction<K,VV> mapper, ExecutionEnvironment context)
public <K,VV,EV> Graph<K,VV,EV> types(Class<K> vertexKey, Class<VV> vertexValue, Class<EV> edgeValue)
vertexKey
- the type of the vertex IDsvertexValue
- the type of the vertex valuesedgeValue
- the type of the edge valuespublic <K,EV> Graph<K,NullValue,EV> edgeTypes(Class<K> vertexKey, Class<EV> edgeValue)
vertexKey
- the type of the vertex IDsedgeValue
- the type of the edge valuespublic <K> Graph<K,NullValue,NullValue> keyType(Class<K> vertexKey)
vertexKey
- the type of the vertex IDspublic <K,VV> Graph<K,VV,NullValue> vertexTypes(Class<K> vertexKey, Class<VV> vertexValue)
vertexKey
- the type of the vertex IDsvertexValue
- the type of the vertex valuespublic GraphCsvReader lineDelimiterEdges(String delimiter)
'\n'
) is used by default.delimiter
- The delimiter that separates the rows.public GraphCsvReader lineDelimiterVertices(String delimiter)
'\n'
) is used by default.delimiter
- The delimiter that separates the rows.public GraphCsvReader fieldDelimiterVertices(String delimiter)
','
) is used by default.delimiter
- The delimiter that separates the fields in a row.public GraphCsvReader fieldDelimiterEdges(String delimiter)
','
) is used by default.delimiter
- The delimiter that separates the fields in a row.public GraphCsvReader parseQuotedStringsEdges(char quoteCharacter)
quoteCharacter
- The character which is used as quoting character.public GraphCsvReader parseQuotedStringsVertices(char quoteCharacter)
quoteCharacter
- The character which is used as quoting character.public GraphCsvReader ignoreCommentsVertices(String commentPrefix)
commentPrefix
- The string that starts the comments.public GraphCsvReader ignoreCommentsEdges(String commentPrefix)
commentPrefix
- The string that starts the comments.public GraphCsvReader includeFieldsVertices(boolean... vertexFields)
n
fields, where n
is the length of the boolean
array. The parser will skip over all fields where the boolean value at the corresponding position
in the array is false
. The result contains the fields where the corresponding position in
the boolean array is true
.
The number of fields in the result is consequently equal to the number of times that true
occurs in the fields array.vertexFields
- The array of flags that describes which fields are to be included from the CSV file for vertices.public GraphCsvReader includeFieldsEdges(boolean... edgeFields)
n
fields, where n
is the length of the boolean
array. The parser will skip over all fields where the boolean value at the corresponding position
in the array is false
. The result contains the fields where the corresponding position in
the boolean array is true
.
The number of fields in the result is consequently equal to the number of times that true
occurs in the fields array.edgeFields
- The array of flags that describes which fields are to be included from the CSV file for edges.public GraphCsvReader includeFieldsVertices(String mask)
n
fields, where n
is the length of the mask string
The parser will skip over all fields where the character at the corresponding position
in the string is '0'
, 'F'
, or 'f'
(representing the value
false
). The result contains the fields where the corresponding position in
the boolean array is '1'
, 'T'
, or 't'
(representing the value true
).mask
- The string mask defining which fields to include and which to skip.public GraphCsvReader includeFieldsEdges(String mask)
n
fields, where n
is the length of the mask string
The parser will skip over all fields where the character at the corresponding position
in the string is '0'
, 'F'
, or 'f'
(representing the value
false
). The result contains the fields where the corresponding position in
the boolean array is '1'
, 'T'
, or 't'
(representing the value true
).mask
- The string mask defining which fields to include and which to skip.public GraphCsvReader includeFieldsVertices(long mask)
n
fields, where n
is the position of the most significant
non-zero bit.
The parser will skip over all fields where the character at the corresponding bit is zero, and
include the fields where the corresponding bit is one.
Examples:
0x7
would include the first three fields.0x26
(binary 100110
would skip the first fields, include fields
two and three, skip fields four and five, and include field six.mask
- The bit mask defining which fields to include and which to skip.public GraphCsvReader includeFieldsEdges(long mask)
n
fields, where n
is the position of the most significant
non-zero bit.
The parser will skip over all fields where the character at the corresponding bit is zero, and
include the fields where the corresponding bit is one.
Examples:
0x7
would include the first three fields.0x26
(binary 100110
would skip the first fields, include fields
two and three, skip fields four and five, and include field six.mask
- The bit mask defining which fields to include and which to skip.public GraphCsvReader ignoreFirstLineEdges()
public GraphCsvReader ignoreFirstLineVertices()
public GraphCsvReader ignoreInvalidLinesEdges()
public GraphCsvReader ignoreInvalidLinesVertices()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.