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

Type change of HiveWarehouseSession from interface to class in HDP 3.1.4 #277

Open
derSascha opened this issue Nov 26, 2019 · 2 comments
Open

Comments

@derSascha
Copy link

Hi,

we wrote Spark code that works on HDP 3.x using the HiveWarehouseSession. In the last version (HDP 3.1.4) it fails with:

java.lang.IncompatibleClassChangeError: Found class com.hortonworks.hwc.HiveWarehouseSession, but interface was expected

This repository does not contain any commits on that, but the files here and the jar files in HDP 3.1.4 contains an abstract class instead of an interface.

Why was that changed? This breaks all compiled code... Is there a known workaround to be compatible with HDP 3.x and HDP 3.1.4+?

@derSascha
Copy link
Author

As a workaround, parts of the HiveWarehouseSession can be used directly:

import com.hortonworks.hwc.HiveWarehouseSession;
...
HiveWarehouseSession session = HiveWarehouseSession.session(sparkSession);

becomes

import com.hortonworks.spark.sql.hive.llap.HiveWarehouseBuilder;
import com.hortonworks.spark.sql.hive.llap.HiveWarehouseSession;
...
HiveWarehouseSession session = HiveWarehouseBuilder.session(sparkSession);

@SalNedia
Copy link

SalNedia commented Nov 2, 2020

I used in this way:
import com.hortonworks.spark.sql.hive.llap.HiveWarehouseBuilder;
import com.hortonworks.spark.sql.hive.llap.HiveWarehouseSession;
...
HiveWarehouseSession session = HiveWarehouseBuilder.session(sparkSession);
HiveWarehouseSessionImpl hive = session.build();
...
hive.setDatabase(db_name);
...

and i get:

User class threw exception: java.lang.NoSuchMethodError: com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl.sql(Ljava/lang/String;)Lorg/apache/spark/sql/Dataset;

Any suggestion?

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

2 participants