[jira] [Assigned] (CASSANDRA-17019) JNA 5.6.0 does not support arm64
[ https://issues.apache.org/jira/browse/CASSANDRA-17019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ganesh Raju reassigned CASSANDRA-17019: --- Assignee: Ganesh Raju (was: Yuqi Gu) > JNA 5.6.0 does not support arm64 > > > Key: CASSANDRA-17019 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17019 > Project: Cassandra > Issue Type: Bug > Components: Dependencies >Reporter: Igamr Palsenberg >Assignee: Ganesh Raju >Priority: Normal > Fix For: 4.1-alpha1, 4.1 > > Attachments: UTs_snappy_upgrading.txt, cassandra_UTs.txt > > > Cassandra depends on net.java.dev.jna.jna version 5.6.0 to do the native > binding into the C library. > JNA 5.6.0 does not support arm64 architecture (Apple M1 devices), causing > cassandra to fail on bootstrap. > Bumping the dependency to 5.9.0 adds arm64 support. Will a PR to bump the > dependency be acceptable ? -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-19508) Getting tons of msgs "Failed to get peer certificates for peer /x.x.x.x:45796" when require_client_auth is set to false
[ https://issues.apache.org/jira/browse/CASSANDRA-19508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mohammad Aburadeh updated CASSANDRA-19508: -- Description: We recently upgraded our production clusters from 3.11.15 to 4.1.4. We started seeing thousands of msgs "Failed to get peer certificates for peer /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is causing a huge problem for us because cassandra log files are growing very fast as our connections are short live connections, we open more than 1K connections per second and they stay live for 1-2 seconds. {code:java} DEBUG [Native-Transport-Requests-2] 2024-03-31 21:26:38,026 ServerConnection.java:140 - Failed to get peer certificates for peer /172.31.2.23:45796 javax.net.ssl.SSLPeerUnverifiedException: peer not verified at io.netty.handler.ssl.ReferenceCountedOpenSslEngine$DefaultOpenSslSession.getPeerCertificateChain(ReferenceCountedOpenSslEngine.java:2414) at io.netty.handler.ssl.ExtendedOpenSslSession.getPeerCertificateChain(ExtendedOpenSslSession.java:140) at org.apache.cassandra.transport.ServerConnection.certificates(ServerConnection.java:136) at org.apache.cassandra.transport.ServerConnection.getSaslNegotiator(ServerConnection.java:120) at org.apache.cassandra.transport.messages.AuthResponse.execute(AuthResponse.java:76) at org.apache.cassandra.transport.Message$Request.execute(Message.java:255) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:166) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:185) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:212) at org.apache.cassandra.transport.Dispatcher$RequestProcessor.run(Dispatcher.java:109) at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:96) at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:61) at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:71) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:142) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) {code} *Our SSL config:* {code:java} client_encryption_options: enabled: true keystore: /path/to/keystore keystore_password: x optional: false require_client_auth: false {code} We should stop throwing this msg when require_client_auth is set to false. Or at least it should be logged in TRACE not DEBUG. I'm working on preparing a PR. was: We recently upgraded our production clusters from 3.11.15 to 4.1.4. We started seeing thousands of msgs "Failed to get peer certificates for peer /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is causing a huge problem for us because cassandra log files are growing very fast as our connections are short live connections, we open more than 1K connections per second and they stay live for 1-2 seconds. {code:java} DEBUG [Native-Transport-Requests-2] 2024-03-31 21:26:38,026 ServerConnection.java:140 - Failed to get peer certificates for peer /172.31.2.23:45796 javax.net.ssl.SSLPeerUnverifiedException: peer not verified at io.netty.handler.ssl.ReferenceCountedOpenSslEngine$DefaultOpenSslSession.getPeerCertificateChain(ReferenceCountedOpenSslEngine.java:2414) at io.netty.handler.ssl.ExtendedOpenSslSession.getPeerCertificateChain(ExtendedOpenSslSession.java:140) at org.apache.cassandra.transport.ServerConnection.certificates(ServerConnection.java:136) at org.apache.cassandra.transport.ServerConnection.getSaslNegotiator(ServerConnection.java:120) at org.apache.cassandra.transport.messages.AuthResponse.execute(AuthResponse.java:76) at org.apache.cassandra.transport.Message$Request.execute(Message.java:255) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:166) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:185) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:212) at org.apache.cassandra.transport.Dispatcher$RequestProcessor.run(Dispatcher.java:109) at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:96) at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:61) at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:71) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:142) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) {code} *Our SSL config:* {code:java} client_encryption_options: enabled: true keystore: /path/to/keystore keystore_password: x optional: false require_client_auth: false {code} We should stop throwing
[jira] [Updated] (CASSANDRA-19508) Getting tons of msgs "Failed to get peer certificates for peer /x.x.x.x:45796" when require_client_auth is set to false
[ https://issues.apache.org/jira/browse/CASSANDRA-19508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mohammad Aburadeh updated CASSANDRA-19508: -- Description: We recently upgraded our production clusters from 3.11.15 to 4.1.4. We started seeing thousands of msgs "Failed to get peer certificates for peer /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is causing a huge problem for us because cassandra log files are growing very fast as our connections are short live connections, we open more than 1K connections per second and they stay live for 1-2 seconds. {code:java} DEBUG [Native-Transport-Requests-2] 2024-03-31 21:26:38,026 ServerConnection.java:140 - Failed to get peer certificates for peer /172.31.2.23:45796 javax.net.ssl.SSLPeerUnverifiedException: peer not verified at io.netty.handler.ssl.ReferenceCountedOpenSslEngine$DefaultOpenSslSession.getPeerCertificateChain(ReferenceCountedOpenSslEngine.java:2414) at io.netty.handler.ssl.ExtendedOpenSslSession.getPeerCertificateChain(ExtendedOpenSslSession.java:140) at org.apache.cassandra.transport.ServerConnection.certificates(ServerConnection.java:136) at org.apache.cassandra.transport.ServerConnection.getSaslNegotiator(ServerConnection.java:120) at org.apache.cassandra.transport.messages.AuthResponse.execute(AuthResponse.java:76) at org.apache.cassandra.transport.Message$Request.execute(Message.java:255) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:166) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:185) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:212) at org.apache.cassandra.transport.Dispatcher$RequestProcessor.run(Dispatcher.java:109) at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:96) at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:61) at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:71) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:142) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) {code} *Our SSL config:* {code:java} client_encryption_options: enabled: true keystore: /path/to/keystore keystore_password: x optional: false require_client_auth: false {code} We should stop throwing this msg when require_client_auth is set to false. Or at least it should be logged in TRACE not DEBUG. I'm working on preparing a PR. was: We recently upgraded our production clusters from 3.11.15 to 4.1.4. We started seeing thousands of msgs "Failed to get peer certificates for peer /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is causing a huge problem for us because cassandra log files are growing very fast as our connections are short live connections, we open more than 1K connections per second and they stay live for 1-2 seconds. We should stop throwing this msg when require_client_auth is set to false. Or at least it should be logged in TRACE not DEBUG. I'm working on preparing a PR. > Getting tons of msgs "Failed to get peer certificates for peer > /x.x.x.x:45796" when require_client_auth is set to false > --- > > Key: CASSANDRA-19508 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19508 > Project: Cassandra > Issue Type: Bug >Reporter: Mohammad Aburadeh >Priority: Urgent > > We recently upgraded our production clusters from 3.11.15 to 4.1.4. We > started seeing thousands of msgs "Failed to get peer certificates for peer > /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is > causing a huge problem for us because cassandra log files are growing very > fast as our connections are short live connections, we open more than 1K > connections per second and they stay live for 1-2 seconds. > {code:java} > DEBUG [Native-Transport-Requests-2] 2024-03-31 21:26:38,026 > ServerConnection.java:140 - Failed to get peer certificates for peer > /172.31.2.23:45796 > javax.net.ssl.SSLPeerUnverifiedException: peer not verified > at > io.netty.handler.ssl.ReferenceCountedOpenSslEngine$DefaultOpenSslSession.getPeerCertificateChain(ReferenceCountedOpenSslEngine.java:2414) > at > io.netty.handler.ssl.ExtendedOpenSslSession.getPeerCertificateChain(ExtendedOpenSslSession.java:140) > at > org.apache.cassandra.transport.ServerConnection.certificates(ServerConnection.java:136) > at > org.apache.cassandra.transport.ServerConnection.getSaslNegotiator(ServerConnection.java:120) > at > org.apache.cassandra.tr
[jira] [Updated] (CASSANDRA-19508) Getting tons of msgs "Failed to get peer certificates for peer /x.x.x.x:45796" when require_client_auth is set to false
[ https://issues.apache.org/jira/browse/CASSANDRA-19508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mohammad Aburadeh updated CASSANDRA-19508: -- Bug Category: Parent values: Degradation(12984)Level 1 values: Performance Bug/Regression(12997) Complexity: Normal Severity: Critical Since Version: 4.0.0 > Getting tons of msgs "Failed to get peer certificates for peer > /x.x.x.x:45796" when require_client_auth is set to false > --- > > Key: CASSANDRA-19508 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19508 > Project: Cassandra > Issue Type: Bug >Reporter: Mohammad Aburadeh >Priority: Urgent > > We recently upgraded our production clusters from 3.11.15 to 4.1.4. We > started seeing thousands of msgs "Failed to get peer certificates for peer > /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is > causing a huge problem for us because cassandra log files are growing very > fast as our connections are short live connections, we open more than 1K > connections per second and they stay live for 1-2 seconds. > We should stop throwing this msg when require_client_auth is set to false. Or > at least it should be logged in TRACE not DEBUG. > I'm working on preparing a PR. -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Created] (CASSANDRA-19508) Getting tons of msgs "Failed to get peer certificates for peer /x.x.x.x:45796" when require_client_auth is set to false
Mohammad Aburadeh created CASSANDRA-19508: - Summary: Getting tons of msgs "Failed to get peer certificates for peer /x.x.x.x:45796" when require_client_auth is set to false Key: CASSANDRA-19508 URL: https://issues.apache.org/jira/browse/CASSANDRA-19508 Project: Cassandra Issue Type: Bug Reporter: Mohammad Aburadeh We recently upgraded our production clusters from 3.11.15 to 4.1.4. We started seeing thousands of msgs "Failed to get peer certificates for peer /x.x.x.x:45796". SSL is enabled but require_client_auth is disabled. This is causing a huge problem for us because cassandra log files are growing very fast as our connections are short live connections, we open more than 1K connections per second and they stay live for 1-2 seconds. We should stop throwing this msg when require_client_auth is set to false. Or at least it should be logged in TRACE not DEBUG. I'm working on preparing a PR. -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832655#comment-17832655 ] Arun Ganesh edited comment on CASSANDRA-19150 at 3/31/24 9:21 PM: -- [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format\(i\))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting all values in the column to strings in the first place. I believe that's why we don't use {{"\{\}".format\(\)}} in cqlsh. We can do it, but it would make the code complex. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. was (Author: JIRAUSER303038): [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format\(i\))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting all values in the column to strings in the first place. I believe that's why we don't use {{"\{\}".format\(\)}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832655#comment-17832655 ] Arun Ganesh edited comment on CASSANDRA-19150 at 3/31/24 9:18 PM: -- [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format\(i\))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting all values in the column to strings in the first place. I believe that's why we don't use {{"\{\}".format\(\)}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. was (Author: JIRAUSER303038): [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format\(i\))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"\{\}".format\(\)}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832655#comment-17832655 ] Arun Ganesh edited comment on CASSANDRA-19150 at 3/31/24 8:49 PM: -- [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format\(i\))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"\{\}".format\(\)}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. was (Author: JIRAUSER303038): [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format(i))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"\{\}".format()}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832655#comment-17832655 ] Arun Ganesh commented on CASSANDRA-19150: - [~bschoeni], It's a catch-22. To use {{print("{0:x}".format(i))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"{}".format()}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832655#comment-17832655 ] Arun Ganesh edited comment on CASSANDRA-19150 at 3/31/24 8:49 PM: -- [~bschoeni], It's a catch-22. To use {{print("\{0:x\}".format(i))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"\{\}".format()}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. was (Author: JIRAUSER303038): [~bschoeni], It's a catch-22. To use {{print("{0:x}".format(i))}} to align values in the column, we should know {{x}}, which should be the length of the longest value in the column (either the longest value or the column header). And, you cannot know {{x}} without converting them to strings in the first place. I believe that's why we don't use {{"{}".format()}} in cqlsh. Instead, we convert all values to strings first (e.g., [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:251], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:331], [here|https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/formatting.py:349], and so on), and later pad it manually to the max-width of each column. > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832601#comment-17832601 ] Brad Schoening edited comment on CASSANDRA-19150 at 3/31/24 5:39 PM: - [~arkn98] in reviewing your questions, I came across [PEP 3101|https://peps.python.org/pep-3101/#standard-format-specifiers] which introduces new alignment specifiers: * '<' - Forces the field to be left-aligned within the available space (This is the default.) * '>' - Forces the field to be right-aligned within the available space. when I ran this test Python seems to default to right align numbers and left align text. Are we overriding this unnecessarily? {code:java} for i in (1,'x',0.0): print("{0:5}".format(i)) 1 x 0.0 {code} was (Author: bschoeni): [~arkn98] in reviewing your questions, I came across [PEP 3101|https://peps.python.org/pep-3101/#standard-format-specifiers] which introduces new alignment specifiers: * '<' - Forces the field to be left-aligned within the available space (This is the default.) * '>' - Forces the field to be right-aligned within the available space. when I ran this test it seems to default to right align numbers and left align text. {code:java} for i in (1,'x',0.0): print("{0:5}".format(i)) 1 x 0.0 {code} > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-19150) Align values in rows in CQLSH right for numbers, left for text
[ https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832601#comment-17832601 ] Brad Schoening commented on CASSANDRA-19150: [~arkn98] in reviewing your questions, I came across [PEP 3101|https://peps.python.org/pep-3101/#standard-format-specifiers] which introduces new alignment specifiers: * '<' - Forces the field to be left-aligned within the available space (This is the default.) * '>' - Forces the field to be right-aligned within the available space. when I ran this test it seems to default to right align numbers and left align text. {code:java} for i in (1,'x',0.0): print("{0:5}".format(i)) 1 x 0.0 {code} > Align values in rows in CQLSH right for numbers, left for text > -- > > Key: CASSANDRA-19150 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19150 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Stefan Miklosovic >Assignee: Arun Ganesh >Priority: Low > Fix For: 5.x > > Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot > 2023-12-09 at 16.58.25.png, signature.asc, test_output.txt, > test_output_old.txt > > Time Spent: 20m > Remaining Estimate: 0h > > *Updated* Jan 17 2024 after dev discussion > Change CQLSH to left-align text while continue to right-align numbers. This > will match how Postgres shell and Excel treat alignment of text and number. > - > *Original* > We need to make this > [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101] > configurable so values in columns are either all on left or on right side of > the column (basically change col.rjust to col.ljust). > By default, it would be like it is now but there would be configuration > property in cqlsh for that as well as a corresponding CQLSH command > (optional), something like > {code:java} > ALIGNMENT LEFT|RIGHT > {code} > cc [~bschoeni] -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org