Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegisterTempTable not found by compiler #684

Open
kvansaders opened this issue Feb 21, 2018 · 0 comments
Open

RegisterTempTable not found by compiler #684

kvansaders opened this issue Feb 21, 2018 · 0 comments

Comments

@kvansaders
Copy link

After attempting to copy the sample code from the readme, I get a compilation error when trying to call the RegisterTempTable method on a data frame.


var sparkConf = new SparkConf();

sparkConf.SetMaster("local[2]"); //local standalone with 2 cores, ex:"spark://master:7077" to connect to other cluster
sparkConf.SetAppName("SparkCLRExample");
//sparkConf.SetSparkHome(""); //used to set the spark install location on worker nodes.  Using default instead.

SparkContext sc = SparkContext.GetOrCreate(sparkConf);


var reqDataFrame = sc.TextFile(@"hdfs://path/to/requests.csv");
var metricDataFrame = sc.TextFile(@"hdfs://path/to/metrics.csv");
reqDataFrame.RegisterTempTable("requests");
metricDataFrame.RegisterTempTable("metrics");
// C0 - guid in requests DataFrame, C3 - guid in metrics DataFrame  
var joinDataFrame = GetSqlContext().Sql(
	"SELECT joinedtable.datacenter" +
		 ", MAX(joinedtable.latency) maxlatency" +
		 ", AVG(joinedtable.latency) avglatency " +
	"FROM (" +
	   "SELECT a.C1 as datacenter, b.C6 as latency " +
	   "FROM requests a JOIN metrics b ON a.C0  = b.C3) joinedtable " +
	"GROUP BY datacenter");
joinDataFrame.ShowSchema();
joinDataFrame.Show();

'RDD' does not contain a definition for 'RegisterTempTable' and no extension method 'RegisterTempTable' accepting a first argument of type 'RDD' could be found (press F4 to add a using directive or assembly reference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant