In Hive, when you create a table, it is stored in a default location or directory in the Hadoop Distributed File System (HDFS). The default location for a table is usually under the user/hive/warehouse directory, with the table name as the subdirectory. The default location can be changed by modifying the hive.metastore.warehouse.dir property in the hive-site.xml configuration file.
To specify a custom location for a Hive table, you can use the LOCATION clause when creating the table. For example, to create a table named Orders with a custom location at /user/training/retail_db/orders, you can use the following statement:
The LOCATION clause specifies the custom location for the table.