Q:

How to remove Hive table bucketing

I mistakenly executed the following ALTER statement with table stocks: 
ALTER TABLE stocks
CLUSTERED BY (exchange, symbol)
INTO 48 BUCKETS;

How to undo this command?

A:

If table is managed, then make it external:
ALTER TABLE stocks SET TBLPROPERTIES('EXTERNAL'='TRUE');

Describe table and note it's location, serde properties and check it is EXTERNAL:
describe formatted stocks;  

Then drop table and create again specifying location, data will remain for EXTERNAL table: 
   DROP TABLE stocks; 

    CREATE EXTERNAL TABLE stocks(
            columns definition)
        STORED AS TEXTFILE --use the same DDL 
        location '/table_location_path'; --use the same path from describe table

Alternatively you can create table with another name pointing to the same location, check it works, make first table EXTERNAL, drop it, rename second table using 
ALTER TABLE tablename RENAME TO stocks.

