java.lang.Object
com.pervasive.datarush.operators.io.textfile.JsonTextAnalyzer
An analyzer for files containing JSON text. An analysis performs a basic
parsing of the file. After analysis, it provides values of fields for
analyzed records. This information can be used to generate a schema for the
records. It could also be used to provide a preview of how a file would be
parsed with given settings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains the results of the analysis of a json text file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanalyze(Path file, CharsetEncoding charsetSpec) Analyzes the specified JSON file based on current configuration.analyze(Path file, CharsetEncoding charsetSpec, FileClient client) Analyzes the specified JSON file based on current configuration.Analyzes the specified JSON file based on current configuration.analyze(String file, CharsetEncoding charsetSpec) Analyzes the specified JSON file based on current configuration.voidsetAnalysisSize(int count) Sets the maximum number of characters to use in analysis.voidsetJsonParserOptions(boolean[] options)
-
Constructor Details
-
JsonTextAnalyzer
public JsonTextAnalyzer()Creates a new JSON analyzer with default settings.
-
-
Method Details
-
setAnalysisSize
public void setAnalysisSize(int count) Sets the maximum number of characters to use in analysis. This value should be large enough to contain at least one records. By default, 1MB is analyzed.- Parameters:
count- the number of characters to analyze
-
setJsonParserOptions
public void setJsonParserOptions(boolean[] options) -
analyze
public JsonTextAnalyzer.JsonAnalysis analyze(String file, CharsetEncoding charsetSpec) throws IOException Analyzes the specified JSON file based on current configuration.- Parameters:
file- path to the delimited text file to analyzecharsetSpec- description of the file's character set encoding- Returns:
- an analysis of the JSON text file
- Throws:
IOException- if an error occurs while reading the file
-
analyze
public JsonTextAnalyzer.JsonAnalysis analyze(Path file, CharsetEncoding charsetSpec) throws IOException Analyzes the specified JSON file based on current configuration.- Parameters:
file- path to the delimited text file to analyzecharsetSpec- description of the file's character set encoding- Returns:
- an analysis of the JSON text file
- Throws:
IOException- if an error occurs while reading the file
-
analyze
public JsonTextAnalyzer.JsonAnalysis analyze(Path file, CharsetEncoding charsetSpec, FileClient client) throws IOException Analyzes the specified JSON file based on current configuration.- Parameters:
file- path to the delimited text file to analyzecharsetSpec- description of the file's character set encodingclient- the authorization context to use for accessing the file- Returns:
- an analysis of the JSON text file
- Throws:
IOException- if an error occurs while reading the file
-
analyze
Analyzes the specified JSON file based on current configuration.- Parameters:
input- the text data to analyze- Returns:
- an analysis of the JSON text file
- Throws:
IOException- if an error occurs while reading the file
-