> For the complete documentation index, see [llms.txt](https://docs.starrocks.io/llms.txt). This page is also available as Markdown at its `.md` URL.

# Other FAQ

This topic provides answers to some general questions.

## Do VARCHAR (32) and STRING occupy the same storage space?[​](#do-varchar-32-and-string-occupy-the-same-storage-space "Direct link to Do VARCHAR (32) and STRING occupy the same storage space?")

Both are variable-length data types. When you store data of the same length, VARCHAR (32) and STRING occupy the same storage space.

## Do VARCHAR (32) and STRING perform the same for the data query?[​](#do-varchar-32-and-string-perform-the-same-for-the-data-query "Direct link to Do VARCHAR (32) and STRING perform the same for the data query?")

Yes.

## Why do TXT files imported from Oracle still appear garbled after I set the character set to UTF-8?[​](#why-do-txt-files-imported-from-oracle-still-appear-garbled-after-i-set-the-character-set-to-utf-8 "Direct link to Why do TXT files imported from Oracle still appear garbled after I set the character set to UTF-8?")

To solve this problem, perform the following steps:

1. For example, there is a file named **original**, whose text is garbled. The character set of this file is ISO-8859-1. Run the following code to obtain the character set of the file.

   ```plaintext
   file --mime-encoding origin.txt
   origin.txt: iso-8859-1

   ```

2. Run the `iconv` command to convert the character set of this file into UTF-8.

   ```plaintext
   iconv -f iso-8859-1 -t utf-8 origin.txt > origin_utf-8.txt

   ```

3. After the conversion, the text of this file still appears garbled. You can then regrade the character set of this file as GBK and convert the character set into UTF-8 again.

   ```plaintext
   iconv -f gbk -t utf-8 origin.txt > origin_utf-8.txt

   ```

## Is the length of STRING defined by MySQL the same as that defined by StarRocks?[​](#is-the-length-of-string-defined-by-mysql-the-same-as-that-defined-by-starrocks "Direct link to Is the length of STRING defined by MySQL the same as that defined by StarRocks?")

For VARCHAR(n), StarRocks defines "n" by bytes and MySQL defines "n" by characters. According to UTF-8, one Chinese character is equal to three bytes. When StarRocks and MySQL define "n" as the same number, MySQL saves three times as many characters as StarRocks.

## Can the data type of partitioned fields of a table be FLOAT, DOUBLE, or DECIMAL?[​](#can-the-data-type-of-partitioned-fields-of-a-table-be-float-double-or-decimal "Direct link to Can the data type of partitioned fields of a table be FLOAT, DOUBLE, or DECIMAL?")

No, only DATE, DATETIME, and INT are supported.

## How to check the storage space that is occupied by the data in a table?[​](#how-to-check-the-storage-space-that-is-occupied-by-the-data-in-a-table "Direct link to How to check the storage space that is occupied by the data in a table?")

Execute the SHOW DATA statement to see the corresponding storage space. You can also see the data volume, the number of copies, and the number of rows.

**Note**: There is a time delay in data statistics.

## How to request a quota increase for the StarRocks database?[​](#how-to-request-a-quota-increase-for-the-starrocks-database "Direct link to How to request a quota increase for the StarRocks database?")

To request a quota increase, run the following code:

```plaintext
ALTER DATABASE example_db SET DATA QUOTA 10T;

```

## Does StarRocks support updating particular fields in a table by executing the UPSERT statement?[​](#does-starrocks-support-updating-particular-fields-in-a-table-by-executing-the-upsert-statement "Direct link to Does StarRocks support updating particular fields in a table by executing the UPSERT statement?")

StarRocks 2.2 and later support updating specific fields in a table by using the Primary Key table. StarRocks 1.9 and later support updating all fields in a table by using the Primary Key table. For more information, see [Primary Key table](https://docs.starrocks.io/docs/table_design/table_types/primary_key_table.md) in StarRocks 2.2.

## How to swap the data between two tables or two partitions?[​](#how-to-swap-the-data-between-two-tables-or-two-partitions "Direct link to How to swap the data between two tables or two partitions?")

Execute the SWAP WITH statement to swap the data between two tables or two partitions. The SWAP WITH statement is more secure than the INSERT OVERWRITE statement. Before you swap the data, check the data first and then see whether the data after the swapping is consistent with the data before the swapping.

* Swap two tables: For example, there is a table named table 1. If you want to replace table 1 with another one, perform the following steps:

  1. Create a new table named table 2.

     ```sql
     create table2 like table1;

     ```

  2. Use Stream Load, Broker Load, or Insert Into to load data from table 1 into table 2.

  3. Replace table 1 with table 2.

     ```sql
     ALTER TABLE table1 SWAP WITH table2;

     ```

     By doing so, the data is loaded accurately into table 1.

* Swap two partitions: For example, there is a table named table 1. If you want to replace the partition data in table 1, perform the following steps:

  1. Create a temporary partition.

     ```sql
     ALTER TABLE table1

     ADD TEMPORARY PARTITION tp1

     VALUES LESS THAN("2020-02-01");

     ```

  2. Load the partition data from table 1 into the temporary partition.

  3. Replace the partition of table 1 with the temporary partition.

     ```sql
     ALTER TABLE table1

     REPLACE PARTITION (p1) WITH TEMPORARY PARTITION (tp1);

     ```

## This error "error to open replicated environment, will exit" occurs when I restart a frontend (FE)[​](#this-error-error-to-open-replicated-environment-will-exit-occurs-when-i-restart-a-frontend-fe "Direct link to This error \"error to open replicated environment, will exit\" occurs when I restart a frontend (FE)")

This error occurs due to BDBJE's bug. To solve this problem, update the BDBJE version to 1.17 or later.

## This error "Broker list path exception" occurs when I query data from a new Apache Hive table[​](#this-error-broker-list-path-exception-occurs-when-i-query-data-from-a-new-apache-hive-table "Direct link to This error \"Broker list path exception\" occurs when I query data from a new Apache Hive table")

### Problem description[​](#problem-description "Direct link to Problem description")

```plaintext
msg:Broker list path exception

path=hdfs://172.31.3.136:9000/user/hive/warehouse/zltest.db/student_info/*, broker=TNetworkAddress(hostname:172.31.4.233, port:8000)

```

### Solution[​](#solution "Direct link to Solution")

Contact the StarRocks technical support and check whether the address and port of the namenode are correct and whether you have permission to access the address and port of the namenode.

## This error "get hive partition metadata failed" occurs when I query data from a new Apache Hive table[​](#this-error-get-hive-partition-metadata-failed-occurs-when-i-query-data-from-a-new-apache-hive-table "Direct link to This error \"get hive partition metadata failed\" occurs when I query data from a new Apache Hive table")

### Problem description[​](#problem-description-1 "Direct link to Problem description")

```plaintext
msg:get hive partition meta data failed: java.net.UnknownHostException: emr-header-1.cluster-242

```

### Solution[​](#solution-1 "Direct link to Solution")

Ensure that the network is connected and upload the **host** file to each backend (BE) in your StarRocks cluster.

## This error "do_open failed. reason = Invalid ORC postscript length" occurs when I access ORC external table in Apache Hive[​](#this-error-do_open-failed-reason--invalid-orc-postscript-length-occurs-when-i-access-orc-external-table-in-apache-hive "Direct link to This error \"do_open failed. reason = Invalid ORC postscript length\" occurs when I access ORC external table in Apache Hive")

### Problem description[​](#problem-description-2 "Direct link to Problem description")

The metadata of the Apache Hive is cached in the FEs. But there is a two-hours time lag for StarRocks to update the metadata. Before StarRocks finishes the update, If you insert new data or update data in the Apache Hive table, the data in HDFS scanned by the BEs and the data obtained by the FEs are different. Therefore, this error occurs.

```plaintext
MySQL [bdp_dim]> select * from dim_page_func_s limit 1;

ERROR 1064 (HY000): HdfsOrcScanner::do_open failed. reason = Invalid ORC postscript length

```

### Solution[​](#solution-2 "Direct link to Solution")

To solve this problem, perform one of the following operations:

* Upgrade your current version to StarRocks 2.2 or later.
* Manually refresh your Apache Hive table. For more information, see [Metadata caching strategy](https://docs.starrocks.io/docs/data_source/External_table.md).

## This error "caching_sha2_password cannot be loaded" occurs when I connect external tables of MySQL[​](#this-error-caching_sha2_password-cannot-be-loaded-occurs-when-i-connect-external-tables-of-mysql "Direct link to This error \"caching_sha2_password cannot be loaded\" occurs when I connect external tables of MySQL")

### Problem description[​](#problem-description-3 "Direct link to Problem description")

The default authentication plugin of MySQL 8.0 is caching_sha2_password. The default authentication plugin of MySQL 5.7 is mysql_native_password. This error occurs because you use the wrong authentication plugin.

### Solution[​](#solution-3 "Direct link to Solution")

To solve this problem, perform one of the following operations:

* Connect to the StarRocks.

```sql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

```

* Modify the `my.cnf` file.

```plaintext
vim my.cnf

[mysqld]

default_authentication_plugin=mysql_native_password

```

## How to release disk space immediately after deleting a table?[​](#how-to-release-disk-space-immediately-after-deleting-a-table "Direct link to How to release disk space immediately after deleting a table?")

If you execute the DROP TABLE statement to delete a table, StarRocks takes a while to release the allocated disk space. To release the allocated disk space immediately, execute the DROP TABLE FORCE statement to delete a table. When you execute the DROP TABLE FORCE statement, the StarRocks deletes the table directly without checking whether there are unfinished events in it. We recommend that you execute the DROP TABLE FORCE statement with caution. Because once the table is deleted, you cannot restore it.

## How to view the current version of StarRocks?[​](#how-to-view-the-current-version-of-starrocks "Direct link to How to view the current version of StarRocks?")

Run the `select current_version();` command or the CLI command `./bin/show_fe_version.sh` to view the current version.

## How to set the memory size of an FE?[​](#how-to-set-the-memory-size-of-an-fe "Direct link to How to set the memory size of an FE?")

The metadata is stored in the memory used by the FE. You can set the memory size of the FE according to the number of tablets as shown in the table below. For example, if the number of tablets is below 1 million, you should allocate a minimum of 16 GB memory to the FE. You can configure the values of the parameters `-Xms` and `-Xmx` in the **JAVA_OPTS** configuration item in the **fe.conf** file, and the values of the parameters `-Xms` and `-Xmx` should be consistent. Note that the configuration should be same across all FEs because any of the FEs can be elected as a Leader.

| Number of tablets | Memory size of each FE |
| ----------------- | ---------------------- |
| below 1 million   | 16 GB                  |
| 1 ～ 2 million    | 32 GB                  |
| 2 ～ 5 million    | 64 GB                  |
| 5 ～ 10 million   | 128 GB                 |

## How does StarRocks calculate its query time?[​](#how-does-starrocks-calculate-its-query-time "Direct link to How does StarRocks calculate its query time?")

StarRocks supports querying data by using multiple threads. Query time refers to the time used by multiple threads to query data.

## Does StarRocks support setting the path when I export data locally?[​](#does-starrocks-support-setting-the-path-when-i-export-data-locally "Direct link to Does StarRocks support setting the path when I export data locally?")

No.

## What are the concurrency upper limits of StarRocks?[​](#what-are-the-concurrency-upper-limits-of-starrocks "Direct link to What are the concurrency upper limits of StarRocks?")

You can test the concurrency limitations based on the actual business scenarios or simulated business scenarios. According to the feedback of some users, maximum of 20,000 QPS or 30,000 QPS can be achieved.

## Why is the first-time SSB test performance of StarRocks slower than that done the second time?[​](#why-is-the-first-time-ssb-test-performance-of-starrocks-slower-than-that-done-the-second-time "Direct link to Why is the first-time SSB test performance of StarRocks slower than that done the second time?")

The speed to read disks for the first query relates to the performance of disks. After the first query, the page cache is generated for the subsequent queries, so the query is faster than before.

## How many BEs need to be configured at least for a cluster?[​](#how-many-bes-need-to-be-configured-at-least-for-a-cluster "Direct link to How many BEs need to be configured at least for a cluster?")

StarRocks supports single node deployment, so you need to configure at least one BE. BEs need to be run with AVX2, so we recommend that you deploy BEs on machines with 8-core and 16GB or higher configurations.

## How to set data permissions when I use Apache Superset to visualize the data in StarRocks?[​](#how-to-set-data-permissions-when-i-use-apache-superset-to-visualize-the-data-in-starrocks "Direct link to How to set data permissions when I use Apache Superset to visualize the data in StarRocks?")

You can create a new user account and then set the data permission by granting permissions on the table query to the user.

## Why does the profile fail to display after I set `enable_profile` to `true`?[​](#why-does-the-profile-fail-to-display-after-i-set-enable_profile-to-true "Direct link to why-does-the-profile-fail-to-display-after-i-set-enable_profile-to-true")

The report is only submitted to the leader FE for access.

## How to check field annotations in the tables of StarRocks?[​](#how-to-check-field-annotations-in-the-tables-of-starrocks "Direct link to How to check field annotations in the tables of StarRocks?")

Run the `show create table xxx` command.

## When I create a table, how to specify the default value for the NOW() function?[​](#when-i-create-a-table-how-to-specify-the-default-value-for-the-now-function "Direct link to When I create a table, how to specify the default value for the NOW() function?")

Only StarRocks 2.1 or later version supports specifying the default value for a function. For versions earlier than StarRocks 2.1, you can only specify a constant for a function.

## How can I release the storage space of BE nodes?[​](#how-can-i-release-the-storage-space-of-be-nodes "Direct link to How can I release the storage space of BE nodes?")

You can remove the directory `trash` using `rm -rf` command. If you have already restored your data from snapshot, you can remove the directory `snapshot`.

## Can add extra disks to BE nodes?[​](#can-add-extra-disks-to-be-nodes "Direct link to Can add extra disks to BE nodes?")

Yes. You can add the disks to the directory specified by the BE configuration item `storage_root_path`.

## How can I prevent expression partition conflicts caused by concurrent execution of loading tasks and partition creation tasks?[​](#how-can-i-prevent-expression-partition-conflicts-caused-by-concurrent-execution-of-loading-tasks-and-partition-creation-tasks "Direct link to How can I prevent expression partition conflicts caused by concurrent execution of loading tasks and partition creation tasks?")

Currently, for tables with the expression partitioning strategy, partitions created during loading tasks conflict with those created during ALTER TABLE tasks. Since loading tasks take priority, any conflicting ALTER tasks will fail. To prevent this issue, consider the following workarounds:

* If you use coarse time-based partitions (or example, partitioning by day or month), you can prevent ALTER operations from crossing time boundaries, reducing the risk of partition creation failures.
* If you use fine-grained time-based partitions (or example, partitioning by hour), you can manually create partitions for a future time range to ensure that ALTER operations are not disrupted by new partition created by loading tasks. You can use the [EXPLAIN ANALYZE](https://docs.starrocks.io/docs/sql-reference/sql-statements/cluster-management/plan_profile/EXPLAIN_ANALYZE.md) feature to trigger partition creation by executing an INSERT statement without committing the transaction. This allows you to create the necessary partitions without affecting actual data. The following example demonstrates how to create partitions for the next 8 hours:

```sql
CREATE TABLE t(
    event_time DATETIME
)
PARTITION BY date_trunc('hour', event_time);

EXPLAIN ANALYZE
INSERT INTO t (event_time)
SELECT DATE_ADD(NOW(), INTERVAL d hour)
FROM table(generate_series(0, 8)) AS g(d);

SHOW PARTITIONS FROM t;

```
