Question

I am using Hive. I have implemented some task in it and wanted to export a table from Hive into SQL Server using SQOOP.

When table gets exported from Hive I want to fire the trigger in SQL Server. Is it possible to fire the trigger?

Pls reply me as soon as possible.

Thanks.

Was it helpful?

Solution 2

I just tried this by creating the trigger and it works fine!!! This has done my job so easy.

I have created the Trigger AFTER INSERT.

OTHER TIPS

As a rule, avoid triggers like the plague. They are a tool of last resort. Anything that can be done in a trigger can be done a thousand times better and faster in a stored procedure, it's where the business logic should be as it's visible, can be optimized and is easier to understand under source control. Triggers are the global variables of the database world, avoid unless there's no other technical solution.

If it's better performance you want from your SQL Servers and you're using Hive to get it, you're going about it the wrong way - you'd be better off looking at moving your business logic into stored procedures you can tune, rather than having it embedded in a trigger.

Using Hive to crack the problem is a real sledgehammer to crack a walnut - you'd be better off looking at your coding practices to get better performance out of SQL Server, unless your dataset is so massive (100Tb+) that you really need to go to a distributed, scale out solution based on Hadoop and Hive. Ask yourself why you're doing it this way. To do so on any smaller data set is really to show ignorance of what relational engines are capable of on relatively modest hardware. We're all guilty of embelishing our CVs with new technology, or wanting something new to play with, but in terms of technical architecture you should be asking yourself if it's necessary. I'm not anti-SQL Server nor am I anti-Hive/Hadoop. Both have their place, horses for courses. But I'm definitely anti-trigger.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top