question: public void registerInput ( String varName , JavaRDD < String > rddIn , String format , long rlen , long clen , FileFormatProperties props , List < ValueType > schema ) throws DMLRuntimeException { if ( ! ( DMLScript . rtplatform == RUNTIME_PLATFORM . SPARK || DMLScript . rtplatform == RUNTIME_PLATFORM . HYBRID_SPARK ) ) { throw new DMLRuntimeException ( "The registerInput functionality only supported for spark runtime. Please use MLContext(sc) instead of default constructor." ) ; } long nnz = - 1 ; if ( _variables == null ) _variables = new LocalVariableMap ( ) ; if ( _inVarnames == null ) _inVarnames = new ArrayList < String > ( ) ; JavaPairRDD < LongWritable , Text > rddText = rddIn . mapToPair ( new ConvertStringToLongTextPair ( ) ) ; int blksz = ConfigurationManager . getBlocksize ( ) ; MatrixCharacteristics mc = new MatrixCharacteristics ( rlen , clen , blksz , blksz , nnz ) ; FrameObject fo = null ; if ( format . equals ( "csv" ) ) { CSVFileFormatProperties csvprops = ( props != null ) ? ( CSVFileFormatProperties ) props : new CSVFileFormatProperties ( ) ; fo = new FrameObject ( OptimizerUtils . getUniqueTempFileName ( ) , new MatrixFormatMetaData ( mc , OutputInfo . CSVOutputInfo , InputInfo . CSVInputInfo ) ) ; fo . setFileFormatProperties ( csvprops ) ; } else if ( format . equals ( "text" ) ) { if ( rlen == - 1 || clen == - 1 ) { throw new DMLRuntimeException ( "The metadata is required in registerInput for format:" + format ) ; } fo = new FrameObject ( null , new MatrixFormatMetaData ( mc , OutputInfo . TextCellOutputInfo , InputInfo . TextCellInputInfo ) ) ; } else { throw new DMLRuntimeException ( "Incorrect format in registerInput: " + format ) ; } if ( props != null ) fo . setFileFormatProperties ( props ) ; fo . setRDDHandle ( new RDDObject ( rddText , varName ) ) ; fo . setSchema ( "String" ) ; _variables . put ( varName , fo ) ; _inVarnames . add ( varName ) ; checkIfRegisteringInputAllowed ( ) ; }
target:  Register Frame with CSV/Text as inputs: with dimensions.  File properties (example: delim, fill, ..) can be specified through props else defaults will be used. <p> Marks the variable in the DML script as input variable. Note that this expects a "varName = read(...)" statement in the DML script which through non-MLContext invocation would have been created by reading a HDFS file.