You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var trainingRDD = rdd.map(function(t, RowFactory, SqlDate, SqlTimestamp) {
var parts = t[2].match(/(\d+)/g);
var date = new Date(parts[0], parts[1]-1, parts[2]);
var time = new Date(Date.parse(t[2]+" "+t[3]));
var row = RowFactory.create([
t[0],
t[1],
new SqlDate(date.getTime()),
new SqlTimestamp(time.getTime()),
parseFloat(t[4]),
parseFloat(t[5]),
t[6]]);
return row;
}, [require('eclairjs/sql/RowFactory'),require('eclairjs/sql/SqlDate'),require('eclairjs/sql/SqlTimestamp')]);
But if you add a require at the global level it does
var RowFactory = require('eclairjs/sql/RowFactory')
var trainingRDD = rdd.map(function(t, RowFactory, SqlDate, SqlTimestamp) {
var parts = t[2].match(/(\d+)/g);
var date = new Date(parts[0], parts[1]-1, parts[2]);
var time = new Date(Date.parse(t[2]+" "+t[3]));
var row = RowFactory.create([
t[0],
t[1],
new SqlDate(date.getTime()),
new SqlTimestamp(time.getTime()),
parseFloat(t[4]),
parseFloat(t[5]),
t[6]]);
return row;
}, [require('eclairjs/sql/RowFactory'),require('eclairjs/sql/SqlDate'),require('eclairjs/sql/SqlTimestamp')]);
The text was updated successfully, but these errors were encountered:
for some reason this code does not work
But if you add a require at the global level it does
The text was updated successfully, but these errors were encountered: